NOTE: This feature is only available for some of our subscriptions. If that is the case, you will see an upgrade prompt when attempting to access it. More information about our currently available subscriptions can be found here: https://instapage.com/plans
An AMP (Accelerated Mobile Page) is designed for campaigns targeted primarily at mobile users, which help you keep your visitors’ attention with loading times of under 1 second. AMP pages are generated differently compared to standard pages, which means the code used on them has to be adapted specifically for AMP. In this article, you can find the code you need to add to your AMP in order to track conversions inside your Google Analytics account.
Any of the codes below will need to be placed in HTML > Body. AMP validation will return errors if the codes are placed anywhere else.
1. Use the following code snippet for tracking only form submissions:
You will need to replace some parts of the code by adding your Google Analytics ID on the 8th and 10th lines and then customizing the"event_name", "event_category", "event_action", and the "event_label" values to match your desired category and action of the event.
2. Use the following code snippet for tracking only a button click. This works with only 1 specific button; if more than 1 button needs to be tracked, the code needs to be edited to contain multiple “buttonClick” key - value pairs while each key needs to be unique. Example: “buttonClick1”, “buttonClick2” etc.
You will need to replace some parts of the code by adding your Google Analytics ID on the 8th and 10th lines, adding the element ID of the button you want to track on the "selector" line, and then customizing the"event_name", "event_category", "event_action", and the "event_label" values to match your desired category and action of the event.
To get the element ID of a button, go to the preview mode or the live page and right click the button, select Inspect and copy the ID as shown in the gif below. The ID will be of the w-A-1 format.
3. Use the following code for tracking a form submission and a button click at the same time:
You will need to replace some parts of the code by adding your Google Analytics ID on the 8th and 10th lines, adding the element ID of the button you want to track on the "selector" line, and then customizing the "event_name", "event_category", "event_action", and the "event_label" values to match your desired category and action of the event.