ampproject / amphtml

The AMP web component framework.
https://amp.dev
Apache License 2.0
14.9k stars 3.88k forks source link

amp-analytics not setting cookies when using self-hosted runtime #38437

Open jerimiahwelch opened 1 year ago

jerimiahwelch commented 1 year ago

Description

amp-analytics not setting cookies when using self-hosted runtime

Reproduction Steps

Observed Behavior:

amp-analytics blocks setting cookies when using a self-hosted runtime.

  1. Go to https://www.bedbathandbeyond.com/amp/wm-optimized/store/s/shower

  2. Observe self-hosted runtime tag

  3. Screen Shot 2022-09-06 at 8 44 45 PM

  4. Observe that "current == proxy" when using self-hosted runtime and checkOriginForSettingCookie() throws error.

  5. Screen Shot 2022-09-06 at 8 47 58 PM

  6. Cookie setting error then leads to a cascade of linker tracking errors and malformed beacons.

  7. Screen Shot 2022-09-06 at 8 50 58 PM

Expected Behavior:

amp-analytics sets cookies to track user journey. The page below is not using self-hosted runtime. Cookies work as expected with linker configurations and _ga cookie tracking.

https://www.bedbathandbeyond.com/amp/store/s/shower

Relevant Logs

No response

Browser(s) Affected

No response

OS(s) Affected

No response

Device(s) Affected

No response

AMP Version Affected

012208242209000, 012109272305001

jerimiahwelch commented 1 year ago

Hi team,

Any update on triaging this?

This affects ~ 8.7 Million pageviews per day.

JakeSquier commented 1 year ago

Hi Team,

As of today, I will begin the process of resolving this issue; Thanks for the detailed report!