Articles on: Getting Started

How to track conversions with ClickGUARD?

Important: You can track conversion with ClickGUARD provided that you’ve previously installed the website tracking code.

Tracking conversion on a “Thank You” page

In order to track conversion on a Thank You page simply paste the following code snippet on the page where a visitor ends up after conversion takes place:

window.cg_conversion = true;

Make sure you place the code snippet before the ending </body> tag, and that the tracking code is installed on this page as well.

Hint: You can also attach additional information (comment and value) to your ClickGUARD conversion events.

Tracking conversion after an event

If you would prefer to register a conversion when an event occurs on your page(s), you can use the same code as the above in an event handler function.

Here's an example of how to attach it to a “Subscribe” button click using plain JavaScript:

window.addEventListener('load', (event) => { document.getElementById('subscribe-button').addEventListener('click',function(){ window.cg_conversion = true; }); });

Here's an example of how to attach it to a “Subscribe” button click using jQuery:

$(function(){ $('#subscribe-button').on('click',function(){ window.cg_conversion = true; }); });

Tracking conversion on specific platforms

Click on one of the links below to learn how to track conversions using the following platforms:

Google Tag Manager

Updated on: 24/02/2023

Was this article helpful?

Share your feedback


Thank you!