How to Set Up Google AdWords Conversion Tracking

If you’re using AdWords to help promote your Hub’s content, linking your Google Analytics account with your Google AdWords account can open up a world of possibilities. 

According to Google, “Linking your AdWords and Google Analytics accounts gives you access to the entire picture of customer behavior, from ad click or impression through your site to conversion. Once you’ve linked your accounts, you can use insights from Analytics to refine and optimize your AdWords campaigns, improving the overall performance of your business.”

Here's how you can get set up in just a few minutes (note: if you do not have access to Custom Code you will not be able to set up AdWords Conversion tracking. Check your account permissions or contact Customer Success for details).

* Also, please note that this article covers setting up Adwords through our native Google Analytics integration.  If you prefer to use our Google Tag Manager integration to implement Adwords, this article is not for you!

Step 1 - Create Conversion & Generate Tag

First things first, login to your Google AdWords account. In the top menu, click Tools and then Conversions from the dropdown. Then click the red '+ Conversion' button on the page that loads. 

On the page that loads, ensure you select Website as the source of the conversions you'd like to track.

Next, you'll need to configure your Conversion's Name, Value, Count, Conversion windows, Category, and Optimization settings.

First, pick a Name for your Conversion. In the example below, we've called our Conversion "Hub Conversions" to keep things simple. When you're finished, click Done to proceed.

Next, decide upon a Value for the Conversion. If you have an idea of how much a Hub Conversion is worth to your business, enter the value here. For example, if your average customer is worth $100 and your lead-to-customer conversion rate is 10%, you may put in $10 as the value ($100 x 10%). If not, you can always choose not to assign a value to the Conversion. Once you've chosen, click Done to continue.

Next, decide how you'd like to count the Conversion. Once you've chosen, click Done to continue.

Next, you'll need to specify your Conversion window. Once you've selected a date range, click Done to continue.

Next, select a Category for your Conversion. In the example below, we've chosen to categorize our Conversion as a Lead. If you're a B2B marketer using Form CTAs, chances are you'll want to categorize your Conversion as either a Lead or a Sign-up, but the choice is up to you. Once you've selected, click Done to continue.

Finally, decide whether or not you would like to include data for this Conversion in your "Conversion for optimization" columns. If you're unsure, you're probably okay to leave it turned ON. Click Done to continue.

Now you're ready to install your tag. 

(1) Click Advanced tag settings;

(2) Under Tracking event, click Click Ex. You'll add this code on your "Buy now" button; and

(3) Copy the code or save the instructions and tag to your computer.

Step 2 - Add Code To Custom HTML 

Login to your Hub and click Appearance from the left menu. On the Appearance page, click the tab for Custom Code.

Make sure you have Custom Code enabled and paste the following code into the HTML section. Remember to hit Save when you're done.

<pre class="prettyprint">
&lt;script type=&quot;text/javascript&quot;
src=&quot;//www.googleadservices.com/pagead/conversion_async.js&quot;&gt;
&lt;/script&gt;</pre>

Step 3 - Add Section of Tag Code to Custom Javascript

In the tag you copied from your AdWords account, find the section of code that looks like this: 

  goog_snippet_vars = function() {
    var w = window;
    w.google_conversion_id = 123456789;
    w.google_conversion_label = "xxxxxxxxxxxxxxxxxxx";
    w.google_remarketing_only = false;
  }
  // DO NOT CHANGE THE CODE BELOW.
  goog_report_conversion = function(url) {
    goog_snippet_vars();
    window.google_conversion_format = "3";
    window.google_is_call = true;
    var opt = new Object();
    opt.onload_callback = function() {
    if (typeof(url) != 'undefined') {
      window.location = url;
    }
  }
  var conv_handler = window['google_trackConversion'];
  if (typeof(conv_handler) == 'function') {
    conv_handler(opt);
  }
}

In your Hub's Custom Code section, paste the copied code into the Javascript section.

IMPORTANT:

Underneath the above section of code, you MUST add the below lines of code to ensure that when a user clicks the CTA "Submit" button, your CTA is able to fire off the Conversion information to AdWords:

Hubs.onCtaFormSubmitSuccess = function() { 
  var url = window.location.href ;   // detects current page URL so it can be passed to Google Script
  goog_report_conversion(url);
};

Remember to hit Save when you're done.

Firing Conversions For Specific CTAs 

If you wish to fire a Conversion only when users submit specific CTAs (for example, only the CTAs that directly apply to Items you're driving AdWords traffic to) you'll need to slightly modify some of the custom javascript from above. 

Replace:

Hubs.onCtaFormSubmitSuccess = function() { 
  var url = window.location.href ;   // detects current page URL so it can be passed to Google Script
  goog_report_conversion(url);
};

With

Hubs.onCtaFormSubmitSuccess = function(ctaId, ctaData, ctaName){
var url = window.location.href ; // detects current page URL to pass to Google
if((ctaId == 12345) || (ctaId == 23456) || (ctaId == 34567)) {
goog_report_conversion(url);
}
};

Remember to update the CTA ID numbers (in the third line) to target the specific CTAs you wish to  fire the Conversion event for. 

Ultimately, your custom javascript should end up looking like the below:

goog_snippet_vars = function() {
var w = window;
w.google_conversion_id = 123456789;
w.google_conversion_label = "XXXXXXXXXXXXXXXXXXX";
w.google_remarketing_only = false;
};

goog_report_conversion = function(url) {
goog_snippet_vars();
window.google_conversion_format = "3";
window.google_is_call = true;
var opt = new Object();
opt.onload_callback = function() {
if (typeof(url) != 'undefined') {
 window.location = url;
}
};

var conv_handler = window['google_trackConversion'];
if (typeof(conv_handler) == 'function') {
conv_handler(opt);
}
};

Hubs.onCtaFormSubmitSuccess = function(ctaId, ctaData, ctaName){
var url = window.location.href ; // detects current page URL to pass to Google
if((ctaId == 12345) || (ctaId == 23456) || (ctaId == 34567)) {
goog_report_conversion(url);
}
};

 


 

That's it! You've integrated AdWords Conversion tracking with your Hub and should see Conversions events occurring inside of AdWords (or Google Analytics, if you have connected AdWords with Google Analytics) in no time.

Previous Article
Integrate your Hub with Google Analytics, AdWords, AdRoll, DoubleClick and more!
Integrate your Hub with Google Analytics, AdWords, AdRoll, DoubleClick and more!

With Google Tag Manager, you can now integrate your Hub with a number of third-party services!

Next Article
Google Analytics Event Tracking & Goal Conversions with Form CTAs
Google Analytics Event Tracking & Goal Conversions with Form CTAs

By firing an Event to your Google Analytics account when a user submits a Form CTA, you'll also be able to ...

Need help with your Google Analytics integration?

Contact Us