We'll be with you in a second

20+ traffic channels supported with API integrations

Docly Child

Tracking: universal tracking script

Estimated reading: 6 minutes

What is a universal tracking script?

Universal script is one of the options we provide for the no redirect tracking. It generates the clickid → records the clickid to the 1st party cookie → reads the tracking parameters of the click → sends all this info to RedTrack → then based on the read tracking parameters including the campaign id (if there is none, click is considered as a direct visit) it recognizes the campaign details and figures out how the click should be parsed next.

RedTrack universal tracking script has the following functions:

  • For affiliate marketers: it can help send traffic from multiple sources to one landing page;
  • For those owning an online store: it offers the possibility to track visits from various paid and organic channels;
  • For those using Facebook, Google, etc., alongside monitoring organic traffic on the same page: our universal tracking script can track your purchased and organic traffic separately.

RedTrack universal tracking script can be of the following types:

  • default – for direct advertisers and e-commerce (for those who don’t have any landing or pre-landing pages);
  • /click support –  for those who work with landing pages;
  • /pre-click support – for those who have 2 landing pages one after another before the offer page.

How to create a script

1. Create target Campaigns. One of them should be a Default campaign for the unattributed (aka organic) traffic. Other campaigns are related to your paid traffic channels. Create as many as you need.

2. Generate your unique script based on your needs.

Tools → Scripts → New fill in the mandatory fields → Save:

Script type – select one of the 3 types:

  • default – choose this one if you plan to work with your own website (e.g. e-com store) where a visitor can click on any link or visit any tab while the target action is always tracked on some other page no matter what the visitor path was before.
  • /click support use it when you lead the visitor from your landing page to a 3rd party offer and use domain.com/click CTA link format
  • /pre-click supportsame as /click support but for a prelanding page with domain.com/preclick CTA link

Title – give your script a name.

Domain – choose a custom tracking domain that will be used in that script. Tying a concrete domain to the concrete landing page is not necessary. You can use one custom tracking domain for everything.

Default campaign – organic traffic campaign.

Attribution – set the attribution model you want to use:

  • First clickfirst recorded inbound click.
  • Last click  – last recorded inbound click.
  • Last paid click last recorded inbound click with tracking parameters.
We always recommend using Last paid click attribution since that is the most accurate way, measures which marketing touchpoint a customer last clicked on or engaged with before purchasing, and gives it 100% of the credit. For the First click attribution data, RT has a conversion path report.

Attribution window – set the attribution window, the period for the first click, and the last paid click models.

Cookie domain – the root domain to place a cookie. This is the root domain of your custom tracking domain.

Example: your script will run on name1.domain.com and name2.domain.com. Add domain.com as the root domain (not https://domain.com and not www.domain.com)

3. Copy the generated script and add it to your landing page code:

It is preferable to place the universal tracking script in the head section of the landing page script.

4. Campaign (the one for the paid traffic channel) → Tracking links and parameters → Universal script → copy the tracking parameters → add the parameters string to the traffic channel you use.

RedTrack will identify the incoming traffic based on the “cmpid” parameter. If there is no “cmpid” in the URL, the traffic will be attributed to the default organic traffic campaign.
Keep in mind that changes to the scripts in RedTrack do not affect the actual script used on your page code. If any changes are made, remember to update the script in the page code, too.

1. Go to Brands → New → Add your brand.
2. On the same page, add the purchase data parameters – Name/Description is what you will see in reports – Roles define their use with CAPI
3. Go to Websites → New → Add your website URL
4. Follow the suggested steps to generate the script → proceed with the rest of the settings according to your needs → save the changes → the script is there

Click here for more details about this part of the setup.

Apart from the website settings where you have the ready-to-use script for this particular website, you can also find the list of your scripts in Tools → Scripts. Here, you can create a new one and edit the existing one:

Keep in mind that changes to the scripts in RedTrack do not affect the actual script used on your page code. If any changes are made, remember to update the script in the page code, too.

Script type – select one of the 3 types:

  • default – choose this one if you plan to work with your own website (e.g. e-com store) where a visitor can click on any link or visit any tab while the target action is always tracked on some other page no matter what the visitor path was before.
  • /click support use it when you lead the visitor from your landing page to a 3rd party offer and use domain.com/click CTA link format
  • /pre-click supportsame as /click support but for a prelanding page with domain.com/preclick CTA link

Title – give your script a name.

Domain – choose a custom tracking domain that will be used in that script. It’s better to use a custom tracking domain for the concrete website where you plan to put a script.

Default campaign – organic traffic campaign.

Attribution – set the attribution model you want to use:

  • First click first recorded inbound click.
  • Last click  – last recorded inbound click.
  • Last paid click last recorded inbound click with tracking parameters.
We always recommend using Last paid click attribution since that, in the most accurate way, measures which marketing touchpoint a customer last clicked on or engaged with before purchasing and gives it 100% of the credit. For the First click attribution data, RT has a Conversion path report.

Attribution window – set the attribution window, the period for the first click, and last paid click models.

Cookie domain – the root domain to place a cookie. This is the root domain of your website.

Example: your script will run on name1.domain.com and name2.domain.com. Please specify domain.com as the root domain (not https://domain.com and not www.domain.com.