AMP Analytics on Shopify

Google Analytics and Facebook Pixel on AMP for Shopify

Written By Stephen Gardner (Super Administrator)

Updated at December 6th, 2022

Key points:

  • AMP by Shop Sheriff seamlessly connects with your Google Analytics and Facebook Pixel accounts from the Settings page.
  • Simply enter your Google Analytics or Facebook Pixel ID and the necessary settings are applied to your AMP pages instantly.  
  • Most merchants use the same Google or Facebook ID that they're using on their non-AMP pages, meaning no additional GA ID or Pixel is necessary.
  • All relevant events are automatically tracked.
  • Google Analytics' new "GA4" is not yet compatible with AMP, but the Google team is working on it.

Setting up Analytics

AMP by Shop Sheriff seamlessly connects with your Google Analytics and Facebook Pixel accounts.  To add these to your AMP pages, insert the necessary Google Analytics and Facebook Pixel IDs into the appropriate fields on your Settings page.

AMP also integrates with Google Tag Manager and Google Ads.  If you are using AMP for Google Ads, we always recommend adding your Ads Conversion ID into the AMP pages.

What events are tracked?

All the necessary events for a standard Google Analytics or Facebook Pixel setup are tracked automatically.  This includes events for Page Views, Add to Carts, and more.  We note all the events here.

Testing analytics events

After you add your Analytics ID to AMP pages, you can test that events are firing.  To do so, open up an AMP page and check your Google Analytics "Real time" report.  You should see Active Pages with "/a/s" in the URL.

Do I need a separate Analytics ID for AMP pages?

We recommend you use the same Google Analytics and Facebook Pixel ID on your AMP pages that you use on your regular pages.  This is what the vast majority of our merchants do, and there is no problem with this method.

Checking analytics on AMP pages

In Google Analytics, you can filter your views on AMP pages by filtering for pages that contain /a/s in the URL.  If you have a custom domain setup, the process is the same, but filter for that custom domain instead.  To filter for pages with /a/s, go to Behavior > Site content > All pages, and enter /a/s in the filter bar, and click Enter.

This view will show you the analytics for your AMP pages, including page view counts.

Google Analytics Remarketing

In order to set up Google Analytics Remarketing, you just need to enter your AdWords conversion ID in the Settings page.

Once you do that, the AMP pages will automatically be set up with the snippet Google Recommends here.  That snippet looks like this:

<amp-analytics type="gtag" data-credentials="include">
<script type="application/json">
{
 
"vars" : {
   
"gtag_id": "ads conversion id",
   
"config" : {
     
"ads conversion id": { "groups": "default" }
   
}
 
}
}
</script>
</amp-analytics>

This will be automatically added, so you don't have to add it manually.  All you have to do is enter the AdWords Conversion ID, as mentioned above.

Google Tag Manager

In rare instances, you may want to use Google Tag Manager.  We have a dedicated blog post on that.  Google Tag Manager is an advanced setup and shouldn't be necessary unless you're trying to implement something that isn't supported out of the box by the Google Analytics or Google AdWords automatic integration.  Since every GTM setup is different, there is no prescribed way to set up Google Tag Manager on AMP pages.  Also, please note that Google Tag Assistant (a browser plugin used for helpful debugging of Google Analytics) doesn't work for a GTM AMP Container, so it may be difficult to diagnose and debug a GTM setup, depending on your specific use case.

Was this article helpful?