Skip to content

[amp-analytics] Should transport be pub's choice? vendor's choice? or AMP's choice? #7096

@lannka

Description

@lannka

We now let analytics vendors specify a default config like this:

"transport": {
  "beacon": boolean,
  "xhrpost": boolean,
  "image": boolean
}

Since publisher can override this, hence the transport is really pub's choice + vendor's choice.
It causes a small problem when publisher overrides with xhrpost=true but vendor does not support it.

The fundamental problem is: the transport should rather be AMP's choice + vendor's choice. Why would pub even care what transport is finally used. Vendor should tell AMP if they support GET or POST. And based on that, AMP should pick the best transport for the current user agent.

The vendor config can be simplified as:

"endpoint": {
  "method": "GET" | "POST", // Supporting POST should also imply CORS enabled. 
}

which should NOT be overridable by pub.

This is kinda related to #6031 . Because with the current config model, it's a bit hard to fit in the new proposed post-with-body.

@avimehta @rudygalfi @dvoytenko thoughts?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions