1. Check if cookie is present, append query parameter as source code .
if(document.cookie.includes('at_check')) {
var separator = (window.location.href.indexOf("?")===-1)?"?":"&";
window.location.href = window.location.href + separator + "SourceCode=INT999T"
}
2. Fire mbox call and update mbox or profie parameters for the mbox which contains offer(i.e Page load with response call) use getOffer or applyOffer
adobe.target.getOffer({
"mbox": "target-global-mbox",
"params": {
"a": 1,
"b": 2,
"profile.age": 27,
"profile.gender": "male"
},
"success": function(offer) {
adobe.target.applyOffer( {
"mbox": "target-global-mbox",
"offer": offer
} );
},
"error": function(status, error) {
console.log('Error', status, error);
}
});
3. User clicks on any link . Pass the parameter to mbox notification call to track the clicktrack
$('a').click(function(event){
adobe.target.trackEvent({ "mbox": "clicked-link",
"params": {
"param1": "value1"}})
});
4. Pass parameters to global mbox
targetPageParams = function() {
return {
"a": 1,
"b": 2,
"profile": {
"memberStatus": Gold,
"country": {
"city": "San Francisco"
}
}
};
};
5. object and method can be used for creating profile script.
Object/Method Details
user.get(‘<par_name>’)
Returns the value of the “user.<par_name>” set for the current visitor; returns null if no value has been set.
6. Flickerlessly to update the image in offer code
(function() { Flickerlessly=window.Flickerlessly||{},function(t){"use strict";var e=function(t,e,a,i){var n="atNodeInserted"+t,o="@keyframes "+n+" {from {opacity:0.99} to {opacity:1} }\n";o+=e+"{animation-duration:0.001s;animation-name:"+n+";visibility:hidden}";var s=document.getElementsByTagName("head")[0];if(s){var r=document.createElement("style");r.setAttribute("type","text/css"),r.styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),s.insertBefore(r,s.firstChild)}var c=function(t){if(t.animationName===n&&"object"==typeof t.target){var o=!0===i||!1===i&&null===t.target.getAttribute("data-flk-success");console&&console.info&&console.info("Node "+e+" ready! Execute: "+o,t.target),"function"==typeof a&&o&&(a(t.target),t.target.setAttribute("data-flk-success",n)),t.target.style.visibility="visible"}};["animationstart","MSAnimationStart","webkitAnimationStart"].forEach(function(t,e){document.addEventListener(t,c,!1)})};t.onReady=function(){for(var t=0;t<arguments.length;t++){var a=arguments[t],i=a.selector,n=a.success||null,o=a.persist||!1,s=Math.floor(100*Math.random()+1);e(s,i,n,o)}}}(Flickerlessly);
Flickerlessly.onReady({ selector: "#sc-lb-module-sc-inline-banner > div.sc-bnr__bg-wrapper > img", persist: true, success: function(el) { injMbox.domManipulation(); } });
var injMbox = injMbox || { domManipulation: function() { document.querySelectorAll("#sc-lb-module-sc-inline-banner > div.sc-bnr__bg-wrapper > img")[0].src = "https://www.jio.com/jio.comm.jpg" } };})();
No comments:
Post a Comment