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.
options = { "clickId": "IDOFCLICK", "campaignId": "CAMPAIGNID", "gifPostbackUrl": "https://multioned-bactempt.icu/conversion.gif?cid=IDOFCLICK&caid=CAMPAIGNID", "offerUrlParameters": {} }? This will allow you to then checkoptions.clickIdoroptions.campaignId. You can still pass the object in as(function(c, d, a, e) { /*...*/ }) (window, "dtpCallback", options, console);