How to add Google Tag Manager to your AMP page?

 Follow the steps below to install Google Tag Manager on your AMP Pages.

Google Tag Manager installation requires going to two different websites, so we’ll break down the process into two different steps:

  • Step 1: Set up your Google Tag Manager AMP container
  • Step 2: Provide the Tag Manager ID in your AMP theme configuration
Step 1: Set up your Google Tag Manager AMP container
  1. Sign in to your Google Tag Manager account.
  2. Click the blue Create Account button at the top right corner of the screen.
  3. Enter a new name in the Account Name field for your AMP container account.
  4. Select your country from the drop-down menu.
  5. Enter the name for your AMP page in the Container Name field.
  6. Click the AMP button under Where to Use Container.
  7. Click the Create button. A new dialog box will appear.
  8. Copy the code provided from the bottom of the dialog box. Click the OK button at the bottom right corner of the dialog box. Note that although Google Tag manager provides code to be added to both the <head> and the <body> of the page, you only have to copy the <body> code as The AMP App generates the code that appears in the <head> automatically.
  9. Click the Submit button at the top right-hand corner of the page. A new dialog box will appear.
  10. In the Submit Changes dialog box, name and describe your new container as you would like, then click the Publish button at the top right corner.
Step 2: Install the Tag Manager code snippet in your AmpifyMe AMP theme configuration
  1. Navigate to the theme where you’d like to install your code snippet in The AMP app theme editor.
  2. Click on the Theme Settings section at the top left-hand corner of the page. 
  3. Select the Analytics section
  4. Paste the script you previously copied from Google Tag Manager into the text field next to the Google Tag Manager script label.
  5. Save your theme.

All set! Google Tag Manager is installed on your AMP pages. To find out how to set up your triggers and events, check out Google’s AMP & Tag Manager Setup Guide.

AmpifyMe team 💙

Still need help? Contact Us Contact Us