Created
May 21, 2017 06:23
-
-
Save faizanayubi/ff2677f79b6248cd0527fb5854aeed5e to your computer and use it in GitHub Desktop.
Track Multiple Conversions from different traffic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document.body).on("click", ".product-btn, .btn-buy", function (e) { | |
e.preventDefault(); | |
var lnk = $(this).attr('href');console.log(lnk); | |
var l = document.createElement("a"); l.href = lnk; | |
var src = 'https://track.vnative.com/pixel?adid=5920681cb6920d372064e102&sub2=' + encodeURIComponent(window.location.pathname) + '&sub3=' + encodeURIComponent(document.title) + '&sub1=' + encodeURIComponent(l.hostname) + '&txn_id=RANDOM'; | |
var body = document.getElementsByTagName('body')[0], img = document.createElement('img'); | |
img.style.width = '1px';img.style.height = '1px';img.style.display = 'none';img.src = src; body.appendChild(img); | |
var win = window.open(lnk, '_blank'); | |
win.focus(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Don't forget to replace the adid(5920681cb6920d372064e102) with your own adid from vNative Panel.