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 results-driven B2B marketing consultant with 15+ years of experience helping businesses boost online visibility, generate qualified leads, and increase sales. Specializing in SEO, HubSpot, and PPC campaign management, Jake leverages proven strategies to deliver measurable growth. As a Certified Google Ads Specialist and HubSpot Developer, he is committed to driving impactful results for his clients.

Related posts

Tags:

Want to Get Email Updates of New Articles?

Join My Email Newsletter