Skip to content

Instantly share code, notes, and snippets.

<script>
// Youtube Video Background for Unbounce. V1.1
// lpVideoBG('#SectionID', 'YoutubeVideoID', width, height, muted);
// Use '#lp-pom-root' for a full page video background
lpVideoBG('#lp-pom-block-9', '2XX5zDThC3U', 560, 315, 0);
function lpVideoBG(pageSectionID, youtubeVideoCode, videoWidth, videoHeight, muted) {
<!--[if lte IE 8]>
<script>
var oldIEhasFlash = false;
try {
oldIEhasFlash = Boolean(new ActiveXObject('ShockwaveFlash.ShockwaveFlash'));
} catch(exception) {
oldIEhasFlash = ('undefined' != typeof navigator.mimeTypes['application/x-shockwave-flash']);
}
</script>
<!--[if lte IE 8]>
<script>
var oldIEhasFlash = false;
try {
oldIEhasFlash = Boolean(new ActiveXObject('ShockwaveFlash.ShockwaveFlash'));
} catch(exception) {
oldIEhasFlash = ('undefined' != typeof navigator.mimeTypes['application/x-shockwave-flash']);
}
</script>
<script type="text/javascript">
var getUrlParams = function() {
var params = {}, hash;
var hashes = decodeURI(window.location.href).replace(/\+/g," ").slice(window.location.href.indexOf('?') + 1).split('&');
for (var i=0; i<hashes.length; i++) {
hash = hashes[i].split('=');
params[hash[0]] = hash[1];
}
return params;
};
<script>
// Youtube Video Background for Unbounce. V1.0
// lpVideoBG('#SectionID', 'YoutubeVideoID', width, height, muted);
// Use '#lp-pom-root' for a full page video background
lpVideoBG('#lp-pom-block-9', '2XX5zDThC3U', 560, 315, 0);
function lpVideoBG(pageSectionID, youtubeVideoCode, videoWidth, videoHeight, muted) {
/*********************************************
* Automated Creative Testing With Statistical Significance
* Version 2.0
* Changelog v2.0
* - Fixed bug in setting the correct date
* - Script now uses a minimum visitors threshold
* per Ad instead of AdGroup
* - Added the ability to add the start date as a label to AdGroups
* - Added ability to check mobile and desktop ads separately
* Changelog v1.1.1 - Fixed bug with getDisplayUrl
@philbar
philbar / AdWords_Scripts_Ad_Testing.js
Last active August 29, 2015 14:00 — forked from russorat/AdWords_Scripts_Ad_Testing.js
Replace Visitor Threshold with Chi-Squared test
/*********************************************
* Automated Creative Testing With Statistical Significance
* Version 2.1
* Changelog v2.1 - Replace Visitor Threshold with Chi-Squared test
* Changelog v2.0
* - Fixed bug in setting the correct date
* - Script now uses a minimum visitors threshold
* per Ad instead of AdGroup
* - Added the ability to add the start date as a label to AdGroups
* - Added ability to check mobile and desktop ads separately