Install tracking script

1. Navigate to the Settings Page

Log in to ConversionTracking.com and go to the 'Goals' page. Click on the Settings icons site for which you want to add the tracking script. You will be directed to the "Settings for [Site Name]" page.

2. Locate the Tracking Code Section

On the settings page, find the section labeled "Tracking Code". This section provides two JavaScript snippets that you need to add to your website.

3. Add the Tracking Code to Your Website

Step 1: Add Script to the <head> Section

Copy the first snippet:

<script defer data-goal-id="SITE_ID" src="cdn.conversiontracking.com/api.js"></script>

Paste this snippet into the <head> section of your website's HTML. This ensures that the tracking code is loaded on every page of your site.

Step 2: Add Script to the Conversion Page

Copy the second snippet:

<script>
window.addEventListener('load', (event) => {
  window._ct("purchase", { revenue: {transaction_id: "ORDER_ID", amount: ORDER_TOTAL}})
});
</script>

Paste this snippet into the relevant conversion page of your website. This could be the order confirmation page or any page where a conversion is completed.

Replace ORDER_ID and ORDER_TOTAL with the appropriate values that correspond to the transaction ID and the total amount of the purchase.

4. Update the Settings

If you make any changes to the site domain or timezone, update them in the respective sections:

  • Site Domain: Update or move to a new domain by entering the new domain and clicking the "Change Domain" button.
  • Site Timezone: Select the appropriate timezone from the dropdown menu and click the "Update Timezone" button.

5. Verify Installation

After adding the tracking code to your website, ensure that it is correctly implemented by visiting the site and performing a test conversion. Check the ConversionTracking.com dashboard to verify that data is being received correctly.

By following these steps, you can successfully add the tracking script to your website and ensure that your conversions are tracked accurately. If you encounter any issues or need further assistance, refer to the help section or contact support for more detailed guidance.

6. Debug Tracking Script Attribution (optional)

To debug your tracking script and see the values for first and last touch install our conversion tracking chrome extension.

Previous
Add a goal