Created
November 2, 2012 20:58
-
-
Save mehdimehdi/4004260 to your computer and use it in GitHub Desktop.
Mobile implementation
This file contains 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
//usuall loyalty program, but hidden | |
var _ptq = _ptq || []; | |
var _punchtab_settings = { | |
key: "291747bccbb1e12abf93c56ecc73b03b", | |
language: "en", | |
display: "inline", | |
earningmap: true | |
}; | |
(function() { | |
var pt = document.createElement('script'); pt.type = 'text/javascript'; pt.async = true; | |
pt.src = ('https:' == document.location.protocol ? 'https://' : 'http://') +'static.punchtab.com/js/pt.js?src=wordpress'; | |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(pt, s); | |
})(); | |
window.ptReady = window.ptReady || []; | |
//create your own connect experience. | |
window.ptReady.push(function () { | |
PT.event.bind("user.disconnected", function (response) { | |
document.getElementById("user-connected").style.display = "none"; | |
document.getElementById("user-disconnected").style.display = "block"; | |
}); | |
PT.event.bind("user.connected", function (response) { | |
document.getElementById("user-connected").style.display = "block"; | |
document.getElementById("user-disconnected").style.display = "none"; | |
var random_number = Math.floor(Math.random()*1000); | |
_ptq.push(["view", {points: 300, ref_id:random_number}]); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment