GA4 conversion tracking for AMP

Important news: AMP support is ending

Starting September 1, 2025, Instapage no longer supports creating, duplicating, or uploading AMPs.

Why we made this change: Google no longer prioritizes AMP pages in search results, and our responsive builder can deliver fast-loading mobile pages that perform similarly or even better across all devices.

Your existing pages will continue to work. Existing AMP pages will remain live and editable, but they will stop receiving new feature updates. For the best experience, we recommend rebuilding these pages using our mobile builder. The quickest way to do that is to save the Instablocks to your library and insert them on a new page. More about mobile design here: https://d.pr/cdOkPA 

 

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 page in order to track conversions inside your GA4 account.

NOTE: If you want to implement GA4 conversion tracking on an AMP page, do not use our native GA4 integration at the same time. It is enough to use the code in this article. 

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.

Tracking form submissions

You will need to replace some parts of the code by adding your GA4 Measurement ID on the 8th and 10th lines and then customizing the "event_name" value.

Tracking button clicks

This code works with only one specific button; if more than one 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 need to replace some parts of the code by adding your GA4 Measurement 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" value.

To get the element ID of a button, go to the live page, right click the button, Inspect element, and take the ID from there. Then place it in the snippet, as shown in the GIF below:

AMP button element ID.gif

 

Tracking form submissions and button clicks at the same time

To track both form submissions and button clicks simultaneously, you need to replace some parts of the code by adding your GA4 Measurement 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" values.