Alexa atrk_acct ID – slash encoding (adding backslash)
-
Hi Weston!
It’s me again ??
First of all want to thanks again for this awesome plugin, it’s nice too see it grows.But there is an issue with
amp_post_template_analytics
hook when I add the Alexa metrics to certify my website using this manual: https://amp-wp.org/documentation/getting-started/analytics/#reader-modeThe thing is my Alexa
atrk_acct
ID has/
in the identifier. So on the page I’ve get\/
in theatrk_acct
parameter.And we can’t certify the website, because Alexa needs >60% coverage with the analytics code.
Here is what support says:
Hi,
Thanks for reaching out. We checked the page you specified (https://******/*****/****/amp) and found the code in your “amp-code.jpg” screenshot, however that is not the exact code that we provide on the https://www.alexa.com/pro/tagcoverage?sid=*******&site=****** page.
This is the code in your screenshot and in the page HTML:
<script src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js" async="" custom-element="amp-analytics"></script>
and
<amp-analytics id="alexa" type="alexametrics" class="i-amphtml-layout-fixed i-amphtml-layout-size-defined" style="width:1px;height:1px;" i-amphtml-layout="fixed"><script type="application/json">{"vars":{"atrk_acct":"XX\/XXXXX","domain":"XXXXX.COM"}}</script></amp-analytics>
Whereas this is the code we provide:
<script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
and
<!-- Start Alexa AMP Certify Javascript --> <amp-analytics type="alexametrics"> <script type="application/json"> {"vars": { "atrk_acct": "XX/XXXXXXX", "domain": "XXXX.COM" }}</script> </amp-analytics> <!-- End Alexa AMP Certify Javascript -->
Here are the specific differences:
- Your first code has extra =”” characters after async.
- Your second code has a lot of extra parameters in the amp-analytics tag.
- The second code is missing all of the necessary spacing in the {“vars”: { – “atrk_acct”: “XX/XXXXXX”, “domain”: “XXXXX.COM” }}?section.
- The second code has an extra character in the atrk id (XX\/XXXXXXX instead of XX/XXXXXX.
Please remove the current code and replace it with the code that we provide on the https://www.alexa.com/pro/tagcoverage?sid=XXXXX&site=XXXXXXX page.
Cheers,
Debbie
Alexa Customer SupportI think the main issue is not the spaces (it sound ridiculous), but the backslash.
Really many thanks!
- The topic ‘Alexa atrk_acct ID – slash encoding (adding backslash)’ is closed to new replies.