data-amp-replace and data-amp-addparams do not work in 1508794187431
What's the issue?
data-amp-replace and data-amp-addparams do not work in AMP version 1508794187431
How do we reproduce the issue?
- Go to https://www.notrayspizza.com/
- Click the
Order Now on Slicebutton
Notice amp-id is not populated in the next page url.

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.
@cvializ @ericlindley-g ptal
I think this is for @zhouyx @rudygalfi
hmm, looks like the CLIENT_ID() resolves to empty. I'll take a look tomorrow.
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 No, we actually added some trigger events.
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.
I'm going to close this for now, but please re-open if there's any additional detail we can go off to investigate.
@sarahgriffis I'm running into this problem, did you ever get it resolved?
@dcmoore-gd Sorry, I don't remember what we ended up doing as a work around.