1

I am a beginner in Javascript, I recently added a tracker to my website which give me a javascript snippet to include in my website.

The tracking works well but I wanna know if I can get the information from this included script:

(function(c, d, a, e) {
    if (c[d]) {
        var f = function() {
            if (a.gifPostbackUrl) return a.gifPostbackUrl;
            e.error("Cannot retrieve click ID. Please, check your offer set up.")
        };
        c[d].registerConversion = function(b) {
            e.warn("Deprecated. You can now use getClickID method to retrieve Click ID and logConversion method to fire conversion postback");
            b(a.clickId)
        };
        c[d].getClickID = function() {
            return a.clickId
        };
        c[d].getTokens = function() {
            return a.offerUrlParameters || {}
        };
        c[d].getConversionPostbackPixelURL = function() {
            return f()
        };
        c[d].logConversion = function(b, c, d) {
            var a = f();
            a && (b && (a += "&payout=" + b), c && (a += "&txid=" + c), d && (a += "&et=" + d), b = document.createElement("img"), b.src = a, b.width = 1, b.height = 1, document.body.appendChild(b))
        };
        c[d].state.callbackQueue.forEach(function(b) {
            return b(a.clickId)
        })
    }
})
(window, "dtpCallback", {
    "clickId": "IDOFCLICK",
    "campaignId": "CAMPAIGNID",
    "gifPostbackUrl": "https://multioned-bactempt.icu/conversion.gif?cid=IDOFCLICK&caid=CAMPAIGNID",
    "offerUrlParameters": {}
}, console);

Please note that campaignID and clickId are variable.

I want to know if it's possible to use javascript code after including this tracking code to get CLICK ID and Campaign ID.

I tried to call function getClickID but it returns as undefined. Can anyone give me a road to follow or help me ?

Thank you.

4
  • I may be missing something, but if you are including that code yourself, why not change it to extract options = { "clickId": "IDOFCLICK", "campaignId": "CAMPAIGNID", "gifPostbackUrl": "https://multioned-bactempt.icu/conversion.gif?cid=IDOFCLICK&caid=CAMPAIGNID", "offerUrlParameters": {} }? This will allow you to then check options.clickId or options.campaignId. You can still pass the object in as (function(c, d, a, e) { /*...*/ }) (window, "dtpCallback", options, console); Commented Dec 1, 2020 at 12:34
  • @VLAZ I am not including that code myself, it's included as link from the tracker, but this is the response of the link ! Commented Dec 1, 2020 at 12:56
  • The script passes a self invoking function. You cannot access any part of it. Commented Dec 1, 2020 at 15:10
  • 1
    @TimonNetherlands In fact I've been able to get it using this : dtpCallback.getClickID(); Commented Dec 1, 2020 at 19:42

1 Answer 1

1

In fact I've been able to get it using this:

dtpCallback.getClickID();

Thank you everyone.

Sign up to request clarification or add additional context in comments.

2 Comments

Would you please share complete working code. The example from very bottom of this link does not seems to be working. doc.voluum.com/en/dtp_customziations.html
dtpCallback.getClickID(); This code works after some time. But I do not want to use setTimeout for that, I wanna use the callback functions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.