How to Add Google AdWords Conversion Tracking on Submit

Follow these steps to track all form submissions that come in through Digioh pop-ups and lightboxes via Google’s conversion tracking.

Part 1: Set Up Your Google Ads Conversion Tracking Code

First, get your Google conversion tracking code. If you don’t know where to find it, or if you’ve never set it up, you can find instructions for setting up your tracking code here. About halfway down the page, you’ll see a gray box with a “guide me” button in it. Click that button to start the set-up process for your conversion tracking code.

set up google ads conversion tracking

At the end of the process, you’ll get a snippet of code.

google ads conversion tracking code snippet

Part 2: Add Your Tracking Code to the JavaScript Editor

Scroll through your code until you see a URL. It will look something like this: “https://www.googleadservices.com/pagead/conversion/4785535602059778/?label=ABCSWSFGU31wQ_MzT3gM&guid=ON&script=0”. Copy that link.

Click your name in the upper-right corner of Digioh, then select Custom Javascript (boxes). Enter the lightbox IDs for any lightboxes you want to track, then paste the following code into the custom JavaScript editor (be sure to put your Google URL in for b.src).

var b = window.parent.document.createElement("img");
                    b.width = 1;
                    b.height = 1;
                    b.src = '[ENTER IN URL from Step #2]"';
Note that using window.parent.document is important. This writes the tracking pixel into the parent to ensure that it has time to fire, even if you configure the Box to close immediately after form submission.

When you’re done, your code should look like this:

digioh custom javascript editor

Hit the Save and Publish LIVE button, and you’ll be all set! Google Ads will now track your pop-up form’s submissions as conversions.

If you need any help setting up conversion tracking for Google Ads, send us an email, and our team will be glad to help you out!

Related Reading: