How to track Google Ads Conversions with a JavaScript Application?


How to track Google Ads Conversions with a JavaScript Application?

I recently ran into an issue tracking Google Ads conversions with imported Google Analytics Goals. I was using a destination goal for a thank you page. This was setup properly but the website was using JavaScript to change the url destination and so did not refresh the page. This prevented the goal from running even though the user was hitting the destination url.

The solution was to fire this event each time your route changes in your JS app. Then create Google Analytics goals based off these events.

gtag('event', 'pageview', {
    'event_category': 'js app',
    'event_label': window.location.pathname
});

 



Written by: Jake Lett
Jake Lett is a B2B marketing consultant with over 15 years of experience in the digital marketing industry. He specializes in SEO, HubSpot, and PPC campaign management. Jake has a proven track record of helping businesses increase their online visibility and drive more traffic, leads and sales. He is a Certified Google Ads Specialist and a Certified HubSpot Developer.

Topic:

Related posts

Tags:

Want to Get Email Updates of New Articles?

Join My Email Newsletter