Will enabling AMP for blog posts affect Google Analytics?

spf
Occasional Contributor

Hi there,

 

From what I've read, enabling AMP will cause some problems with Google Analytics. If a user moves from an AMP page to a non-AMP page, GA will see it as a new session. To fix this, you need to implement "session stitching" by adding some code to your pages.

 

My question: If you enable AMP on your HubSpot blog, does HubSpot take care of this problem on its own, or will I need to manually set up session stitching? 

 

Thanks

Reply
0 Upvotes
5 Replies 5
Community Superstar

Would you care to cite the source of your info regarding the AMP-GA issue?

Hope that helps.

 

Best,
Frank

 

MFrankJohnson-dot-com-HubSpot-Community-banner-gif-v20190817

Reply
0 Upvotes
Highlighted
Community Superstar

_hubspot-button-accept-as-solution-gif-v00.gif

Help other HubSpot searchers find this post quickly by accepting this solution today.

 

Q: If you enable AMP on your HubSpot blog, does HubSpot take care of this problem on its own, or will I need to manually set up session stitching?

 

Short A: n/a

 

Longer A:

If nothing else, we know that all HubSpot blogs are not created equal.

 

That being said, we confirmed that HubSpot does NOT appear to add the following session stitching code to the <head> section of HubSpot AMP-enabled blog pages by default.

(at least not the blog we tested)

 

<p><meta name="amp-google-client-id-api" content-"googleanalytics"></p>

 

 

Here's the official Google Search Console AMP Test redirection page when testing http://devblog.frankinbound.com/blog/how-to-copy-hubspot-deal-properties-to-contacts-companies using the Google AMP Test.

(see image)

mfjlabs-screenshot-AMP Test - Links To AMP Page - Google Search Console-20180904-094210.png

 

Here's the official Google Search Console AMP Test for the linked HubSpot AMP page. Notice that the 'amp-google-client-id-api' code is missing.

(see image)

mfjlabs-screenshot-AMP Test - Google Search Console-20180904-093249.png

 

As you can see, the HubSpot blog pages are LINKED to AMP pages, so not sure if adding the needed code to those AMP pages is even an option.

 

Always happy to help you build on HubSpot.

 

Best,
Frank


hubspot-solutions-signature-mfrankjohnson-v05.png

www.MFrankJohnson.com

Hope that helps.

 

Best,
Frank

 

MFrankJohnson-dot-com-HubSpot-Community-banner-gif-v20190817

spf
Occasional Contributor

Still confused on the issue.

 

Since you have AMP pages enabled, can you verify that if a user visits an AMP page, and then navigates to a non-AMP page on your website, that GA does not consider it 2 sessions?

Reply
0 Upvotes
Community Superstar

Sorry, no GA installed on our dev sites. Logic would follow that it should behave precisely as described in the Moz article you cited as the basis for your original question. Now, I'm confused.

Hope that helps.

 

Best,
Frank

 

MFrankJohnson-dot-com-HubSpot-Community-banner-gif-v20190817

Reply
0 Upvotes