Conversion Tracking
Qviro offers a conversion tracking service that enables clients with active ad campaigns to gain insight into their total number of conversions, and which part of these conversions originate from Qviro.
In order to get started with conversion tracking you will need a campaignId string, which is generated by us. Please reach out: hello@qviro.com if you are interested in using conversion tracking.
Activating conversion tracking requires the installation of two scripts on your website. The Parameter Capture script, and the Conversion Tracking script.
Parameter Capture Script
This script should be installed on all pages that Qviro users will navigate to. It transforms data from a URL parameter into a cookie that the following conversion tracking script can use. The cookie has a lifetime of 7 days.
It can be installed using the following script tag:
<script src="https://qviro.com/api/conversion/cp.js" async></script>Conversion Tracking Script
This script reads the cookie that was set by the previous script in order to differentiate between regular visitors to your page, or visitors that originated from Qviro. It should be installed on the page that you want to track conversions on, for example a thank you page.
The script will send a request to our API, which will then be registered as a conversion in our system.
There are two ways to install the conversion tracking script, depending on when you want to register the conversion:
Conversion on page load
To register a conversion on page load, the script can be installed using the following script tag:
<script src="https://qviro.com/api/conversion/ct.js?campaignId=abcd1234" async></script>The script takes a single parameter, campaignId, which is the ID that we have provided you with.
Conversion on button click
To register a conversion on a button click, the script can be installed using the following script tag:
<script type="text/javascript" async>
// Replace the text on the right hand side of the '=' with the id of your button.
// Make sure you do not remove the single quotes.
var buttonId = 'submitFormButton' // Change this to the ID of your button
var campaignId = 'abcd1234' // Change this to the campaignId we have provided you with
// DO NOT CHANGE THE CODE BELOW
var conversionHasBeenTracked = false;
function conversionListener() {
if (conversionHasBeenTracked) return;
conversionHasBeenTracked = true;
var ct = document.createElement('script');
ct.type = 'text/javascript';
ct.async = true;
ct.src = "https://qviro.com/api/conversion/ct.js?campaignId=" + campaignId;
document.head.appendChild(ct);
};
var button = document.getElementById(buttonId);
button.addEventListener(
'click',
conversionListener
);
</script>This script will track the first click on the button with the specified ID, and then prevent further tracking of the same button click.