Support Forum › Support Forum › GDPR Cookie Compliance › Trigger a conversion tracking tag
- AuthorPosts
[moove_avatar-150x150.png]September 14, 2023 @ 2:01 pmHi there,
We’ve currently got a Google Ads conversion tag set to load in the head of our contact form submission page, however, we can see in the Chrome Inspector that this conversion tag is loading before the Cookie Compliance plugin is loading the GA Tag so it’s generating an error in the console and failing to record the conversion. We obviously need this conversion tag to load only after the GA Tag has loaded. How can this be achieved?
Thanks,
Ian.Hi Ian,
Thanks for using our plugins.
Are you able to put the Google Ads conversion tag inside of the GDPR plugin too?
[moove_avatar-150x150.png]September 15, 2023 @ 8:49 amI wondered that but the issue is that the conversion tag must only be loaded on the conversation page so there would need to be some way of only loading that part of the code based on a URL condition. Is there a way to add conditional logic into that code?
There might be, the best is to check our Documentation. It’s part of the plugin, if you go to the CMS > GDPR > Documentation
It lists all available hooks and scripts that you can use with our plugin.
Hope this helps.
[moove_avatar-150x150.png]September 15, 2023 @ 9:32 amI’ve found a way to make this work, which might help your other users.
To get Google Ads’ conversion tag to load ‘after’ the main GA tracking code, I placed a global variable in the <head> of the conversion page
<script> var conversionPage = true; </script>
I then added the following script into the GDPR Cookie Compliance plugin (for the relevant cookie type) under the GA tracking code.
<!– Global site tag (gtag.js) – Google Ads: XXXXXXXXX –>
<script async src=”https://www.googletagmanager.com/gtag/js?id=AW-XXXXXXXXX”></script>
<script>
console.log(‘ga tag loaded’);
window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag(‘js’, new Date()); gtag(‘config’, ‘AW-XXXXXXXXX’);
</script><script>
if (typeof conversionPage !== ‘undefined’ && conversionPage === true) {
console.log(‘gtag conversions loaded’);
gtag(‘event’, ‘conversion’, {
‘send_to’: ‘AW-XXXXXXXXX/[your conversion ID here]’,
‘transaction_id’: ”
}); // Google Ads Conversion Tag
}
</script>You could include the LinkedIn conversion tag into that function too, just make sure to add the main LinkedIn tracking tag above this script.
Wonderful, thank you for sharing the solution!
AuthorPostsViewing 6 posts - 1 through 6 (of 6 total)The topic ‘Trigger a conversion tracking tag’ is closed to new replies.
© 2026 Moove Agency Ltd, London, United Kingdom, Reg. 07291892
Innovating with WordPress since 2010© 2026Moove Agency Ltd, London, United Kingdom, Reg. 07291892
This website uses only essential cookies to provide you with the best browsing experience.
AcceptClose GDPR Cookie Settings- Privacy Overview
- Strictly Necessary Cookies
Privacy OverviewThis website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
Strictly Necessary CookiesStrictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.
Enable or Disable Cookies Enabled DisabledEnable All Save Settings
Web Proxy Viewer | New URL | Original Page