amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

data-amp-replace and data-amp-addparams do not work in 1508794187431

Open sarahgriffis opened this issue 9 years ago • 9 comments

What's the issue?

data-amp-replace and data-amp-addparams do not work in AMP version 1508794187431

How do we reproduce the issue?

  1. Go to https://www.notrayspizza.com/
  2. Click the Order Now on Slice button

Notice amp-id is not populated in the next page url. screen shot 2017-10-27 at 5 01 19 pm

screen shot 2017-10-27 at 5 01 27 pm

Our code is <a href="https://slicelife.com/restaurants/ny/brooklyn/11217/not-ray-s-pizza/menu" data-amp-replace="CLIENT_ID" data-amp-addparams="amp_id=CLIENT_ID(amp_id)">

What browsers are affected?

All browsers are affected.

Which AMP version is affected?

This is a new issue in 1508794187431. We would love to pin our AMP version to 1507083985898.

sarahgriffis avatar Oct 27 '17 21:10 sarahgriffis

@cvializ @ericlindley-g ptal

dvoytenko avatar Nov 01 '17 21:11 dvoytenko

I think this is for @zhouyx @rudygalfi

aghassemi avatar Nov 01 '17 23:11 aghassemi

hmm, looks like the CLIENT_ID() resolves to empty. I'll take a look tomorrow.

zhouyx avatar Nov 02 '17 00:11 zhouyx

Here's what I found. When we try to handle outgoing links with data-amp-addparams, we resolve url replacement sync. That say we only try to see if clientId has be requested before, if so get its value. This is not a new issue, I tried with version 1507083985898 and could still reproduce the error.

@sarahgriffis Did you recently remove a pageview analytics or pixel trigger ? That could be a reason why this started to not work recently.

The fix for AMP can be trying to read cookie when try to resolve clientId sync.

zhouyx avatar Nov 02 '17 17:11 zhouyx

@zhouyx No, we actually added some trigger events.

sarahgriffis avatar Nov 04 '17 12:11 sarahgriffis

As @zhouyx said in her last update, the CLIENT_ID substitution will only work if CLIENT_ID has been previously requested, see: https://github.com/ampproject/amphtml/blob/master/spec/amp-var-substitutions.md#substitution-timing.

Is there an example of the before and after configurations? Strictly adding some trigger events doesn't seem like something that would cause this.

rudygalfi avatar Nov 13 '17 18:11 rudygalfi

I'm going to close this for now, but please re-open if there's any additional detail we can go off to investigate.

rudygalfi avatar Jan 04 '18 18:01 rudygalfi

@sarahgriffis I'm running into this problem, did you ever get it resolved?

dcmoore-gd avatar Mar 26 '20 20:03 dcmoore-gd

@dcmoore-gd Sorry, I don't remember what we ended up doing as a work around.

sarahgriffis avatar Mar 27 '20 15:03 sarahgriffis