Direct Tracking Script Customizations

Direct tracking script allows you to add various functionalities that extend its main usage. The following document describes various use cases of customizing Direct tracking script.

How Does It Work?

The idea is to add functions to the the dtpCallback method. This new function will execute your code after loading parameters of a visit. The general template for this function looks as follows:

dtpCallback(function (params) { 
    // your code goes here
    // parameters (offer links, dynamic tokens, campaign ID (cpid) )

Upon loading our direct tracking script along with parameters, the following methods become available at dtpCallback scope.


Voluum Note: Whichever function you go with, you still have to create a script based on this function on your own.

  1. Generate links: dtpCallback.generateLinks()

    You can use this function to generate offer links in place of click URLs that weren’t present in the HTML of your page at the moment of loading response of script.

    • Use case: Your landing page includes a multi-step quiz that generates new HTML with every step. The final step of the quiz includes a link to the offer page.

  2. Get tokens: dtpCallback.getTokens()

    By using this function, you can retrieve dynamic tokens resolved by Voluum.

    • Use case: Customize your landing page using the visitor’s information to adjust content and improve click through rate. Read more in the Dynamic Call-Outs

  3. Get offer links: dtpCallback.getOfferLink(optional.offer.number)

    This function allows you to get the offer link set in your campaign in Voluum and use it for your custom needs. In case of a multi-offer landing page, you can pass the offer number in this function in order to get a proper offer link.

    • Use case: Dynamically redirect visitors to an offer page by using JavaScript instead of relying on elements with click URL links.

  4. Register click: dtpCallback.registerClick(optional.offer.number)

    This function simply makes a request to Voluum to register a click.

    • Use case: This function may be useful when combined with other functions, such as getOfferLink. In this case, you may want to force register a click and redirecting a visitor elsewhere.

  5. Tracking organic traffic

    • You can use direct tracking script to track organic traffic coming to your campaign. More on that in the Track Organic Traffic article.

Example 1. 

dtpCallback(function(params) {
//dtpCallback.getTokens() - to ensure tokens are available and visit parameters have been already fetched