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
NAsummary = function (df, include.nan = FALSE) | |
{ | |
newdf = data.frame(col = 1:ncol(df), Count = nrow(df), nNA = sapply(df, | |
function(x) length(x[is.na(x)]))) | |
newdf$rNA = newdf$nNA/newdf$Count | |
newdf$rNA = trunc(newdf$rNA * 10000)/10000 | |
if (include.nan) { | |
newdf$nNan = sapply(df, function(x) length(x[is.nan(x)])) | |
newdf$rNan = newdf$nNan/newdf$Count | |
newdf$rNan = trunc(newdf$rNan * 10000)/10000 |
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
<script> | |
var clientId = ga.getAll()[0].get('clientId'); | |
dataLayer.push({ | |
'UAID': clientId, | |
'event': 'UAID' | |
}); | |
</script> |
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
if (navigator.userAgent.match(/Mobi/)) { | |
// mobile! | |
var windowWidth = window.screen.width < window.outerWidth ? | |
window.screen.width : window.outerWidth; | |
if(windowWidth < 683){ | |
deviceType = 'mobile'; | |
} else { | |
deviceType = 'tablet'; | |
} | |
} |
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
<script type="text/javascript"> | |
if(window.location.href.indexOf("&mc_cid")) { | |
var a_mc_cid = location.search.split('&')[7]; | |
var b_mc_cid = a_mc_cid.split('=')[1]; | |
var a_mc_eid = location.search.split('&')[8]; | |
var b_mc_eid = a_mc_eid.split('=')[1]; | |
dataLayer.push ({ 'event': 'mailchimp', 'eventCategory': b_mc_cid, 'eventAction': b_mc_eid, 'eventLabel': '{{WPeventId}}', 'nonInteraction': 1 }); | |
}; | |
</script> |
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
<script> | |
function makeid() | |
{ | |
var text = ""; | |
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |
for( var i=0; i < 16; i++ ) | |
text += possible.charAt(Math.floor(Math.random() * possible.length)); | |
return text; | |
}; | |
var wp_event_ID = makeid(); |