Monster Energy Series 2019 Phoenix Preview – NASCAR


Monster Energy Series 2019 Phoenix Preview | NASCAR.com



‘);
AMPTManager.renderSingleSlot(mobile_adUnit, [300,250],slotTargeting,null,null,0,true,true);
}

function updateSponsorAd () {
list = document.querySelectorAll(‘[gallery-id]’);
Array.prototype.forEach.call(list, function(elem) {
if (checkInViewport(elem)) {
var gallerySponsoredCheck = (elem.getAttribute(“gallery-sponsored”) == “1”) ? 1 : 0;
if (gallerySponsoredCheck == 1) {
$(‘#presentedByContainer’).show();
} else {
$(‘#presentedByContainer’).hide();
}
}
});
}

function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[[]]/g, ‘\$&’);
var regex = new RegExp(‘[?&]’ + name + ‘(=([^]*)|&|#|$)’),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return ”;
return decodeURIComponent(results[2].replace(/+/g, ‘ ‘));
}

( function( $ ) {
$(document).ready(function() {
/*setTimeout(function(){window.gigya.socialize.getUserInfo(
{
callback: function(gigyaData) {
url = “https://y645918ab4.execute-api.us-east-1.amazonaws.com/stage/getlikedphotos?mode=get&userId=” + gigyaData.UID;
jQuery.getJSON(url).done(function(data) {
items = data.body;
if(items.constructor == Array) {
for(var i = 0; i -1){
language=”es_US”;
}
var prefix;
if(window.analyticsChannelGlobal){
prefix = window.analyticsChannelGlobal;
}else{
prefix= ‘nscr’;
}
window.digitalData = {
page:{
pageInfo: {
pageName: prefix + “-” + language + “:photo-galleries:galleries:” + galleryPageName,
pageURL: pageURL,
channel: “photo-galleries”,
title: galleryPageName,
siteSubSection:”galleries.nascar.com”,
siteSubSection2:”nscr-” + language
}
}
};

if (“undefined” !== typeof analytics_comscore_id) {
(self.COMSCORE && COMSCORE.beacon({c1: “2”, c2: analytics_comscore_id}));
}
jQuery.ajaxSetup({ cache: false });
jQuery.ajax({ url: “//www.nascar.media/wp-content/themes/ndms-2016/inc/analytics/ComScorePageView.xml” });
try {
if(s){
s.linkTrackVars=”eVar43,prop22,events”;
s.eVar43=photoNum;
s.prop22=digitalData.page.pageInfo.pageName;
s.pageName = digitalData.page.pageInfo.pageName;

s.linkTrackEvents=”event61,event72″;
s.events=”event61,event72″;

s.t(this,”o”,photoNum);
}
} catch (exception) {
console.error(exception);
}

//REFRESH ALL ADS EVERY 3 IMAGES
if ( adCount > 2 ){
refreshPageAds();

// if mobile, append rectangle ad unit after every third gallery image
if (windowSize 768) {
var desktop_adUnit = ‘ad_bnr_btf_01’; var slotTargeting = [];
slotTargeting.push([‘pos’,[desktop_adUnit]]);
jQuery(“.galleryContainer”).append(”);
AMPTManager.renderSingleSlot(desktop_adUnit, [728,90],slotTargeting,null,0,true,true);
}

jQuery(“.galleryContainer”).append(data[‘galleryHTML’]);

lastGalleryID = data[‘galleryID’];
galleryIDs.push(lastGalleryID);

lazyLoadGalleries();
},
error: function (xhr, status, error) {
var err = eval(“(” + xhr.responseText + “)”);
console.log(“err”, err);
}
});

//Record page view in dynamo
setDynamoCount(currentID);
}
},
successLoader: function(element) {
element.load();
console.log(“loaded…”, element);
},
errorLoader: function(element) {
element.error();
console.log(“failed…”, element);
}
});
});
$(window).scroll(function(){
list = document.querySelectorAll(‘[gallery-id]’);
Array.prototype.forEach.call(list, function(elem){
if (checkInViewport(elem)){
inViewGalleryID = elem.getAttribute(“gallery-id”);
inViewGalleryFranchise = elem.getAttribute(“gallery-franchise”);

//new gallery in view check
if (inViewGalleryID != currentID || inViewGalleryFranchise != galleryFranchise){
console.log(“Gallery not a match!”, elem.childElementCount);
photoTotal = elem.childElementCount – 1; //count gallery images minus gallery title div

var galleryTitle = elem.getAttribute(“gallery-title”),
gallerySponsored = (elem.getAttribute(“gallery-sponsored”) == “1”) ? 1 : 0;
galleryFranchise = elem.getAttribute(“gallery-franchise”);
galleryURL = elem.getAttribute(“gallery-url”);

updatePageURL(galleryTitle, galleryURL);
triggerAds(galleryFranchise, gallerySponsored);

currentID = inViewGalleryID;

//Record page view in dynamo
setDynamoCount(currentID);
}
}
});
});
});
})( jQuery );

//run ad sponsored check on page load to be sure it’s showinghiding appropriately
$( document ).ready(function() {
updateSponsorAd();
});






Leave a Reply

Your email address will not be published.