Welcome to the Instapage Support Center

|

Using the Google Ads conversion tracking tag

To get started you will have to connect your page to Google Ads (ex-AdWords) by following the instructions in this article. If you need more advanced metrics tracked with Google Ads, you will have to customize and add their conversion tracking script following the instructions below.

Conversions will be triggered either by button clicks, by form submissions, or by visits to a thank you page (used as a conversion page).

The code snippets will need to be placed in Settings - Javascript - Body.

settings_button.png

JAVASCRIPT.png

javascript_body_.jpg

1. Button clicks

For tracking button clicks on your page, you will need to use the following code snippet and customize it to fit your needs: 

<script>
ijQuery(document).ready(function(){
ijQuery('#elementID a').on('click', function() {
// add your event code here
});
});
</script>

You will need to customize the code with the Google Ads tracking script and change the #elementID with the corresponding element ID that you want to trigger the event. The element ID can be changed by right-clicking on the element and selecting the Inspect option.

For example, your code should look like this: 

<script>
ijQuery(document).ready(function(){
ijQuery('#element-123 a').on('click', function() {
gtag('event', 'conversion', {'send_to': 'AW-123456789/AbC-D_efG-h12_34-567'});
});
});
</script>

 2. Form submissions

When tracking form submissions, in case of a single form on the page, you can use this code snippet: 

<script type="text/javascript">
window.instapageFormSubmitSuccess = function( form ){
//add your event code here;
};
</script>

As mentioned in Google's documentation, below is the code snippet for the Google Ads conversion page:

<script>
  gtag('event', 'conversion', {'send_to': 'AW-123456789/AbC-D_efG-h12_34-567'});
</script>

For example, the code in case of tracking a form will look like this: 

<script type="text/javascript">
window.instapageFormSubmitSuccess = function( form ){
gtag('event', 'conversion', {'send_to': 'AW-123456789/AbC-D_efG-h12_34-567'});
};
</script>

If you have multiple forms on the page, you can use this code snippet: 

<script>
window.instapageFormSubmitSuccess = function( form, wid ){

if ( wid === 6 )
{
//add your event code here;
}
else if ( wid === 7 )
{
//add your event code here;
}
else
{
// do nothing out of a box
}

};
</script>

For this second code snippet, you will need to edit the wid value, which is the numerical value of the element ID. For #element-659, the wid value is 659.

3. Thank You page

You can also track conversions with a Thank You page. The Google Ads conversion tracking tag that was implemented on the landing page will fire upon page visit. This tracking tag, as Google mentioned, needs to be implemented on a Thank You page, because it will load only after the user has converted.

If you want to track conversions with a Thank You page, please follow the instructions described in this article.

Have more questions? Submit a request
Was this article helpful?
0 out of 0 found this helpful

Need Further Help?

Tell us what you need and we will be happy to assist you.

Our team of expert support staff and our community can answer your questions. Submit a ticket, or reach out on live chat!