Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMP Google Analytics not working #6740

Closed
ankurp opened this issue Dec 19, 2016 · 10 comments
Closed

AMP Google Analytics not working #6740

ankurp opened this issue Dec 19, 2016 · 10 comments

Comments

@ankurp
Copy link

ankurp commented Dec 19, 2016

Please walk through the following steps for reporting an issue about AMP:

Short description of your issue:

Google analytics used to work with <amp-analytics> tag and has stopped working for about a month.

How do we reproduce the issue?

USA Today which uses Google Analytics does not trigger a Google analytics call https://cdn.ampproject.org/v/amp.usatoday.com/story/95582484/?amp_js_v=6

  1. Open the link above in browser
  2. Open Network tab and look for collect call which never fires for the site
  3. Confirm by viewing the source that the <amp-analytics> tag for Google analytics is there in the source of the HTML.

What browsers are affected?

Tested only in Chrome but should not matter

Which AMP version is affected?

Using v0 of AMP

@jridgewell
Copy link
Contributor

I don't see a <amp-analytics type="googleanalytics"> anywhere on the page? Only a type="comscore", and a custom which defines its own requests to https://srepdata.usatoday.com.

@ankurp
Copy link
Author

ankurp commented Dec 19, 2016

@jridgewell This is an issue with another website which does specify <amp-analytics type="googleanalytics"> If you view the source of this site you will see the markup is there and set correctly but google analytics does not fire https://cdn.ampproject.org/v/s/www.bloomberg.com/gadfly/amp/articles/2016-11-15/human-bond-pickers-find-redemption-against-indexing?amp_js_v=6

@jridgewell
Copy link
Contributor

/to @avimehta

@lannka, maybe you could help?

@jpettitt
Copy link
Contributor

We are seeing the analytics tag firing at a doubleclick address instead of the normal GA one and it's not including our extra vars. This is only pageview events - our visibility events are still hitting www.google-analutoics.com/collect

https://stats.g.doubleclick.net/r/collect?v=1&aip=1&t=dc&_r=3&tid=UA-73338518-2&cid=amp-fHZgKWzWlyzNG9qJZynjfnZuFZw-7y-8TvyZokMMAd8x95daLFPrGlvFV6IKFu2L&jid=0.3412224567191007&_v=a1&z=0.09046188048244419

@jpettitt
Copy link
Contributor

See also #6714

@jridgewell
Copy link
Contributor

Cross posting #6714 (comment):

This is due to Chrome not showing redirected XHR requests in the Network DevTools. Testing in Firefox, I see two XHRs:

  1. POST to www.google-analytics.com
    • Includes extra params
    • Returns 302 redirect to stats.g.doubleclick.net
  2. GET to https://stats.g.doubleclick.net
    • No extra params

Is your data being logged incorrectly in doubleclick.net?

@jpettitt
Copy link
Contributor

@cramforce
Copy link
Member

Can we close this?

@ankurp
Copy link
Author

ankurp commented Dec 20, 2016

@cramforce This can be closed if 302 is the correct status code and response for Google analytics call that has extra parameters.

@cramforce
Copy link
Member

You should be able to verify with Safari or Firefox devtools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants