e.setItem('firstPageVisit', 'true'); } sessionStorage.setItem('previousURL', window.location.href); /**mboxData = _satellite.getVar('Mbox Selector'); const mboxObject = { data: mboxData, decisionScopes: ['__view__'], renderDecisions: false, xdm: { _experience: { decisioning: { propositions: [{ scope: '__view__' }], propositionEventType: { display: 1 }, }, }, event: 'All Pages Decisioning', eventType: 'decisioning.propositionDisplay', web: { webPageDetails: { martechId: "mainPageview" } }, }, }; window.alloy('sendEvent', mboxObject);**/ //if(tmg_p13n){ //visStatus = "Repeat"; //}else{ //visStatus = "New"; //} var visStatus = _satellite.getVar('TMG Repeat User Status'); visStatus += tmg_pid ? ';Logged in' : ';Logged out'; /**if (tmg_p13n && tmg_p13n.indexOf('readerType') != -1) { var arr = tmg_p13n.split(','); for (var i = 0; i < arr.length; i++) { if (arr[i].indexOf('readerType') != -1) { visStatus += arr[i].indexOf('subscriber') != -1 ? ';Subscriber' : ';Registered'; } } } else if (tmg_pid) { visStatus += ';Registered'; } else { visStatus += ';Anonymous'; }**/ if (tmg_p13n) { if(tmg_p13n.indexOf('subscriptionTypeExtension') != -1){ console.log("sub stuff happening here"); visStatus += ";Subscriber"; }else{ visStatus += ";Registered"; } }else{ visStatus += ";Anonymous"; } dimensionContainer.visitorstatus = visStatus; var currAdBlockStatus = localStorage.getItem('adBlockStatus') !== null ? localStorage.getItem('adBlockStatus') : ''; if (currAdBlockStatus !== '') { dimensionContainer.adBlockStatus = currAdBlockStatus; } //***Change Commented Out - Not to be included in ICID Test Release*** //TMG - 1660 s.campaign mapping //let ECID = _satellite.getVar('TMG ECID'); //if (ECID) { //console.log('Value of ECID = ' + ECID) //s.eVar140 = ECID //dimensionContainer.externalCampaign = ECID; //console.log('v140 = ' + s.eVar140) //} //propensity scores //eVar1: URL v1 - URL - prop1 pUrl = window.location.href; pageInfo.URL = pUrl; //eVar2: Page Name v2 - pathname prop5 if (new RegExp(/secure\.telegraph\.co\.uk\/customer\/subscribe\/|www\.telegraph\.co\.uk\/customer\/subscribe\//).test(window.location.href)) { pageInfo.pageName = window.location.pathname.replace(/\/index\.html$/, ''); } else { pPathname = _satellite.getVar('TMG DL rollupContentPath'); pPathname = pPathname ? pPathname : window.location.pathname.replace(/\/$/, ''); pageInfo.pageName = pPathname.replace(/\/index\.html$/, ''); } //eVar6: Domain v6 - %TMG domain% domain = _satellite.getVar('TMG domain'); pageInfo.domain = domain; //eVar7: Content Type v7 - %TMG Meta Content Type% contentType = _satellite.getVar('TMG Meta Content Type'); pageInfo.contentType = contentType; //eVar9: CustomerID (PID) v9 - %TMG Cookie customerID% - prop29 var localStoragePID = localStorage.getItem('tmg_pid'); customerPID = _satellite.getVar('TMG Cookie customerID') ? _satellite.getVar('TMG Cookie customerID') : localStoragePID; pageInfo.customerID = customerPID; //eVar11: Article Publish Date v11 - %TMG Meta Article Publish Date% - prop11 articlePublishDate = _satellite.getVar('TMG Meta Article Publish Date'); pageInfo.articlePublishDate = articlePublishDate; //eVar17: Platform v17 - %TMG Responsive Site Viewports% - prop17 platform = _satellite.getVar('TMG Responsive Site Viewports'); pageInfo.siteViewports = platform; //eVar18: MLC v18 - %TMG Meta MLC% - prop18 mlc = _satellite.getVar('TMG Meta MLC'); pageInfo.mlc = mlc; //eVar20: Gallery ImageNo v20 - %TMG galleryImageNo% galleryImageNo = _satellite.getVar('TMG galleryImageNo'); pageInfo.galleryImageNo = galleryImageNo; //eVar21: Business Segment v21 - %TMG Meta Business Segment% prop21 businessSegment = _satellite.getVar('TMG Meta Business Segment'); pageInfo.businessSegment = businessSegment; //eVar26: Story Type v26 - %TMG DL storyType% - prop10 storyType = _satellite.getVar('TMG DL storyType'); pageInfo.storyType = storyType; //eVar27: Email campaign etype v27 - %TMG emailType% - prop26 etype = _satellite.getVar('TMG emailType'); pageInfo.eType = etype; //eVar29: Page ID v29 - %TMG DL pageID% - prop23 dlPageID = _satellite.getVar('TMG DL pageID'); pageInfo.dlPageID = dlPageID; //eVar37: Browser Speed eVar 37 - %TMG Browser Speed% speed = _satellite.getVar('TMG Browser Speed'); pageInfo.browserSpeed = speed; //eVar38: Author eVar 38 - %TMG Meta Author% author = _satellite.getVar('TMG Meta Author'); pageInfo.author = author; if(_satellite.getVar('CMP Cookie')){ dimensionContainer.cookieConsent = _satellite.getVar('CMP Cookie'); }else{ dimensionContainer.cookieConsent = "rejected"; } //eVar43: Paywall Displayed v43 - %TMG paywallDisplayed% - prop43 //paywallDisplayed = _satellite.getVar('TMG paywallDisplayed'); //pageInfo.paywallDisplayed = paywallDisplayed; //eVar44: Spark CampaignID v44 - %TMG Meta Spark CampaignID% - propr44 sparkCampaignID = _satellite.getVar('TMG Meta Spark CampaignID'); pageInfo.sparkCampaignID = sparkCampaignID; //eVar45: Spark Campaign Status v45 - %TMG campaignLive% - prop45 sparkCampaignStatus = _satellite.getVar('TMG campaignLive'); pageInfo.sparkCampaignStatus = sparkCampaignStatus; //eVar49: Flake ID v49 - %TMG DL flakeID% flakeID = _satellite.getVar('TMG DL flakeID'); pageInfo.flakeID = flakeID; //eVar53: Spark Sponsor - %TMG Meta Spark Sponsor% - prop53 sparkSponsor = _satellite.getVar('TMG Meta Spark Sponsor'); pageInfo.sparkSponsor = sparkSponsor; //eVar59: Video Playlist Name v59 - %TMG videoPlaylist% videoPlaylistName = _satellite.getVar('TMG videoPlaylist'); pageInfo.videoPlaylistName = videoPlaylistName; //eVar91 (Standard, Premium): Page Type v91 - %TMG DL pageType% pageType = _satellite.getVar('TMG DL pageType'); pageInfo.pageType = pageType; //eVar111 (Premium): Time since publish v111 - %TMG timeSincePublish% timeSincePublished = _satellite.getVar('TMG timeSincePublish'); pageInfo.timeSincePublished = timeSincePublished; //eVar112 (Premium): Article Publish Time v112 - %TMG Meta Article Publish Time% articlePublishTime = _satellite.getVar('TMG Meta Article Publish Time'); pageInfo.articlePublishTime = articlePublishTime; //eVar118 (Premium): Regwall Displayed v118 - %TMG regwallDisplayed% regwallDisplayed = _satellite.getVar('TMG regwallDisplayed'); pageInfo.regwallDisplayed = regwallDisplayed; //eVar128 CMP Status if(typeof tmgCMP != "undefined"){ dimensionContainer.cmp = tmgCMP.rejectAll; } //eVar141 (Premium): Internal Campaign (ICID) v141 - %TMG icid% icid = _satellite.getVar('TMG icid'); pageInfo.icid = icid; //eVar155 (Premium): Local Date v155 - %TMG Local Date% - prop46 localDate = _satellite.getVar('TMG Local Date'); pageInfo.localDate = localDate; //eVar197 (Premium): MID v197 - %TMG MCVISID% /**mid = _satellite.getVar('ECID'); console.log("check ECID: "+mid); pageInfo.mid = mid;**/ //eVar183 propensityStorage = _satellite.getVar('Piano Propensity Scores'); if(propensityStorage == "null"){ propensityValue = "no_score+no_score+"; }else{ propensityValue = propensityStorage; } cleanPropensity = propensityValue.replace(/0/g, "zero"); dimensionContainer.propensityScores = cleanPropensity; //eVar242 dimensionContainer.userAgent = navigator.userAgent; //prop2: Page Title c2 - %TMG articleTitle% articleTitle = _satellite.getVar('TMG articleTitle'); pageInfo.articleTitle = articleTitle; //prop3: Content Type c3 - eVar7 //prop4: Previous Page c4 - %TMG referrerStripped% previousPage = _satellite.getVar('TMG referrerStripped'); pageInfo.previousPage = previousPage; //prop5: Page Name c5 - D=pageName //prop6: Domain c6 - %TMG domain% domain = _satellite.getVar('TMG domain'); pageInfo.domain = domain; //prop9: Premium Content c9 - v3 //prop15: Channel c15 - v15 //prop22: GA Tracking Code c22 - v22 //prop35: Premium Page Name c35 - v93 //evar239 dimensionContainer.rmid = _satellite.getVar('Rocketmill ID'); dimensionContainer.whatsappchannel = _satellite.getVar('WhatsApp Channel Access'); dimensionContainer.cmpPageId = window.tmg.instanceId; dimensionContainer.cltcscore = _satellite.getVar("CLtC Meta Tag"); subsType = _satellite.getVar('TMG SubscriptionType'); pageInfo.subscriptionType = subsType; flexiRegID = _satellite.getVar('TMG FlexiReg'); flexRegChannel = _satellite.getVar('TMG FlexReg Channel'); flexiRegIdLookup = { "5TRs9Gz6yJeqBWps":"01", "NQ9V5Q5nzJ8Bd4cZ":"03", "vDbUP5wNbL8Mi9sb2":"07", "Tt7va7XAyrpaLNsSJ":"14", "neU5cTyEaGzt8pTN":"21", "S8z0AaW2n3qJbjNvD":"30", "dCAfU5JMyJ3jW8sy":"90" } flexiRegID = flexiRegIdLookup[flexiRegID]; if(typeof flexiRegID != "undefined" && flexiRegID != ""){ flexiString = "flex-reg_"+flexiRegID+"_"+flexRegChannel; dimensionContainer.flexiReg = flexiString; } if (sessionStorage.getItem('firstPageVisit') === 'true' && previousPage) { sessionStorage.setItem('firstPageVisit', 'false'); } //PID Persistance: TGT-728 ********************************************* if (new RegExp(/secure\.telegraph\.co\.uk/).test(window.location.href)) { pid = _satellite.getVar('TMG userPID'); window.adobeDataLayer.push({ "event":"timeOnPreviousPage", "_tmg":{ "dimensionContainer":{ "customerID":pid } } }); } //********************************************************************** //console.log("after initial pgv block"); //console.log("Adobe Launch Loaded: facebook check 1"); //set article tags //console.log("COMMENTS: "+dataLayer.comments); tags = _satellite.getVar('TMG Meta Keywords').replace(/(?:\r\n|\r|\n|\t)/g,' ').replace(/,/g, ";"); //wordCount = _satellite.getVar('TMG Article Word Count'); //s.list2 = tags; pageInfo.articleTags = tags; if(typeof tags != "undefined" && tags != "") { tags = tags.replace(/;/g, ","); tmgFunctions.setCookie("artTags", tags); } //Time on previous page try { var dateNow = Date.now(); var dateThen = _satellite.readCookie('_topp'); if (typeof(dateThen) != 'undefined') { var dateDifference = Math.round((dateNow - dateThen) / 1000); if (typeof(dateDifference) == 'number') { //s.events = typeof s.events == 'undefined' ? 'event18=' + dateDifference : s.events + ',' + 'event18=' + dateDifference; eventDateDiff = "1:"+dateDifference window.adobeDataLayer.push({ "event":"timeOnPreviousPage", "_tmg":{ "eventContainer":{ "timeOnPreviousPage":eventDateDiff } } }); } } _satellite.setCookie('_topp', dateNow, 0.020833); //_satellite.cookie.set('_topp', dateNow, 0.020833); } catch (err) {} var channel = _satellite.getVar('TMG Meta Channel'); console.info("us channel is: "+channel); var category = _satellite.getVar('TMG Meta Category'); var genre = _satellite.getVar('TMG Meta Genre'); var utmSource = _satellite.getVar('TMG utmSource'); var utmMedium = _satellite.getVar('TMG utmMedium'); var utmCampaign = _satellite.getVar('TMG utmCampaign'); var businessSegment = _satellite.getVar('TMG Meta Business Segment'); var rollupContentPath = _satellite.getVar('TMG DL rollupContentPath'); var pageID = _satellite.getVar('TMG DL pageID'); //s.prop7 = document.querySelector('link[href*="/etc/design"][type="text/css"]') ? 'AEM' : 'Other'; cms = document.querySelector('link[href*="/etc/design"][type="text/css"]') ? 'AEM' : 'Other'; pageInfo.cms = cms; if(document.querySelector(".escenicMetadata")){ //s.prop7 = "Escenic"; cms = "Escenic"; pageInfo.cms = cms; } function isNumber(value) { return /^\d+$/.test(value); } function containsHyphens(value) { return /-/.test(value); } //s.eVar15 = channel; pageInfo.channel = channel; if(new RegExp(/education\-and\-careers/).test(window.location.href)) { console.log("this is the edu2 page"); //if(s.eVar15 == "portal") { //console.log("this is the edu page with portal set"); //s.eVar15 = "educationandcareers"; channel = "educationandcareers"; pageInfo.channel = channel; } } if (new RegExp(/\/us\//).test(window.location.href)) { if (new RegExp(/\/us\/news|\/us\/politics/).test(window.location.href)) { channel = "world-news"; } else { channel = genre; if (isNumber(genre) || containsHyphens(genre)) { channel = category; } } pageInfo.channel = channel; pageInfo.businessSegment = channel; //if(pageInfo.channel == ""){ //pageInfo.channel = _satellite.getVar('TMG Meta Channel'); //} } //pageInfo.channel = "testchannel"; //console.log("after education pgv check"); //s.eVar22 = utmSource && utmMedium && utmCampaign ? utmSource + ';' + utmMedium + ';' + utmCampaign : ''; gaTrackingCode = utmSource && utmMedium && utmCampaign ? utmSource + ';' + utmMedium + ';' + utmCampaign : ''; pageInfo.gaTrackingCode = gaTrackingCode; //s.eVar110 = typeof dataLayer != 'undefined' && dataLayer.videoEmbedCount ? dataLayer.videoEmbedCount : ''; videoCount = typeof dataLayer != 'undefined' && dataLayer.videoEmbedCount ? dataLayer.videoEmbedCount : ''; pageInfo.videoCount = videoCount; var businessSegmentMapping = _satellite.getVar('TMG businessSegmentMapping'); for (var segmentPattern in businessSegmentMapping) { if (new RegExp(segmentPattern).test(businessSegment)) { businessSegment = businessSegmentMapping[segmentPattern]; } } if (window.location.hash.indexOf('source=refresh') != -1) { //s.events = typeof s.events == 'undefined' ? 'event7' : s.events + ',' + 'event7'; window.adobeDataLayer.push({ "event":"autoRefresh", "_tmg":{ "eventContainer":{ "autoRefresh":1 } } }); } //console.log("after autorefresh pgv check"); if (pageID) { //s.events = typeof s.events == 'undefined' ? 'event17:' + pageID : s.events + ',' + 'event17:' + pageID; eventPageId = pageID; window.adobeDataLayer.push({ "event":"uniqueArticleView", "_experience":{ "analytics":{ "event1to100": { "event17": { "id":eventPageId, "value": 1 } } } } }) } //console.log("after unique aricle view pgv check"); if (window.location.host == 'register.moneytransfer.telegraph.co.uk' && window.location.pathname == '/') { //s.events = typeof s.events == 'undefined' ? 'event100' : s.events + ',' + 'event100'; window.adobeDataLayer.push({ "event":"moneyTransferApplicationStep1", "_tmg":{ "eventContainer":{ "moneyTransferApplicationStep1":1 } } }); } //console.log("after money transfer pgv check"); //s.eVar3 = _satellite.getVar('TMG DL premiumContent') ? _satellite.getVar('TMG DL premiumContent') : 'false'; premiumPage = _satellite.getVar('TMG DL premiumContent') ? _satellite.getVar('TMG DL premiumContent') : 'false'; pageInfo.premiumPage = typeof premiumPage !== 'string' ? premiumPage.toString() : premiumPage; // TGT-703; //s.eVar33 = _satellite.getVar('TMG Meta premiumContentOnFirstPublish') ? _satellite.getVar('TMG Meta premiumContentOnFirstPublish') : 'false'; premiumOnFirstPublish = _satellite.getVar('TMG Meta premiumContentOnFirstPublish') ? _satellite.getVar('TMG Meta premiumContentOnFirstPublish') : 'false'; pageInfo.premiumOnFirstPublish = premiumPage; //console.log("after premium first publish pgv check"); //s.eVar35 = _satellite.getVar('TMG DL premiumOverride') ? _satellite.getVar('TMG DL premiumOverride') : 'false'; premiumOverride = _satellite.getVar('TMG DL premiumOverride') ? _satellite.getVar('TMG DL premiumOverride') : 'false'; pageInfo.premiumOverride = premiumOverride; //s.pageName = rollupContentPath ? rollupContentPath : window.location.pathname.replace(/\/$/, ''); //s.channel = businessSegment ? businessSegment : s.eVar15; //channel = businessSegment ? businessSegment : ""; //pageInfo.channel = channel; //console.log("after channel pgv check"); //s.hier1 = s.eVar15 + ';' + category + ';' + genre; //s.referrer = /https?:\/\/tgr\.ph\//.test(document.referrer) ? 'https://www.facebook.com/' : s.referrer; //console.log("before referrer pgv check"); //referrer = ""; //referrer = /https?:\/\/tgr\.ph\//.test(document.referrer) ? 'https://www.facebook.com/' : document.referrer; //webData.webReferrer = {}; //webData.webReferrer.URL = referrer; //console.log("after referrer pgv check"); //s.eVar106 = 'Launch - aem'; publishedDate = 'Launch - aem'; pageInfo.publishDate = publishedDate; //console.log("after publishedDate pgv check"); //s.eVar232 = _satellite.getVar("TMG Facebook Bypass"); facebookBypass = _satellite.getVar("TMG Facebook Bypass"); pageInfo.facebookBypass = facebookBypass; //s.eVar233 = "false"; googleShowcase = "false"; if(_satellite.getVar("TMG Google Showcase")){ //s.eVar233 = "true"; googleShowcase = "true"; } pageInfo.googleShowcase = googleShowcase; //console.log("after google showcase pgv check"); //s.eVar39 = _satellite.getVar('TMG DL premiumContent') == 'true' ? 'D=pageName' : ''; premiumArticleBeforeReg = _satellite.getVar('TMG DL premiumContent') == 'true' ? _satellite.getVar('TMG DL rollupContentPath') : ''; pageInfo.premiumArticleBeforeReg = premiumArticleBeforeReg; //s.eVar73 = _satellite.getVar('TMG DL premiumContent') == 'true' ? 'D=pageName' : ''; premiumArticleBeforeSub = _satellite.getVar('TMG DL premiumContent') == 'true' ? _satellite.getVar('TMG DL rollupContentPath') : ''; pageInfo.premiumArticleBeforeSub = premiumArticleBeforeSub; //s.eVar93 = _satellite.getVar('TMG DL premiumContent') == 'true' ? 'D=pageName' : ''; if(typeof dataLayer.premiumPage != "undefined"){ //s.eVar3 = dataLayer.premiumPage; // premiumPage = dataLayer.premiumPage; // TGT-703 premiumPage = typeof dataLayer.premiumPage !== 'string' ? dataLayer.premiumPage.toString() : dataLayer.premiumPage; // TGT-703 pageInfo.premiumPage = premiumPage; //console.log("premium page check activated 2"); premiumPage = ""; if(dataLayer.premiumPage == false){ //premiumPage = "false"; }else if(dataLayer.premiumPage == true){ //s.eVar39 = 'D=pageName'; //s.eVar73 = 'D=pageName'; //s.eVar93 = 'D=pageName'; premiumArticleBeforeReg = window.location.pathname; pageInfo.premiumArticleBeforeReg = premiumArticleBeforeReg; premiumArticleBeforeSub = window.location.pathname; pageInfo.premiumArticleBeforeSub = premiumArticleBeforeSub; } //console.log("prem1 "+s.eVar39); //console.log("prem2 "+s.eVar73); //console.log("prem3 "+s.eVar93); } if(typeof dataLayer.channel != "undefined" && dataLayer.channel != ""){ //console.log("channel dl activated"); //s.eVar15 = dataLayer.channel channel = dataLayer.channel; pageInfo.channel = channel; } //s.eVar139 = _satellite.getVar("TMG Article Content") == 'true' ? 'D=pageName' : ''; var articleID = _satellite.getVar('TMG DL pageID'); pageInfo.articleIdBeforeReg = _satellite.getVar("TMG Article Content") == 'true' ? articleID : ''; pageInfo.articleBeforeReg = _satellite.getVar("TMG Article Content") == 'true' ? _satellite.getVar('TMG DL rollupContentPath') : ''; articleBeforeReg = _satellite.getVar("TMG Article Content") == 'true' ? _satellite.getVar('TMG DL rollupContentPath') : ''; //create the local storage var contentType = _satellite.getVar('TMG Meta Content Type'); if(contentType) { var countArticle = 0; var nonArticles = [ "thirdpartysite", "html", "shorthand", "iframe", "registration", "product", "undefined", "destination", "hotelreview", "cartoon", "article", "blog", "text/html; charset=utf-8", "third party site", "anonymized" ]; console.info("4 us channel at this point is: "+pageInfo.channel); for(i=0; i < nonArticles.length; i++) { if(nonArticles[i] == contentType) { countArticle++; } } if(typeof contentType != "undefined" && contentType != "" && contentType !== null && typeof contentType !== null && countArticle == 0 ) { author = _satellite.getVar('TMG Meta Author'); author = author.replace(/; /g, "+ "); //contentType aTag = _satellite.getVar('TMG Meta Keywords').replace(/(?:\r\n|\r|\n|\t)/g,' ').replace(/,/g, "+"); premiumContent = _satellite.getVar('TMG DL premiumContent') ? _satellite.getVar('TMG DL premiumContent') : 'false'; prevPage = _satellite.getVar('TMG referrerStripped'); currURL = window.location.pathname; //s.eVar167 = author; //s.eVar168 = contentType; //s.eVar170 = premiumContent; //s.eVar171 = prevPage; pageInfo.lastArticleAuthor = author; pageInfo.lastArticleContentType = contentType; pageInfo.lastArticlePremium = premiumContent; pageInfo.lastArticlePrevious = prevPage; //s.eVar176 = currURL; //was already commented out } if (contentType.indexOf('gallery') > -1) { //s.eVar182 = _satellite.getVar('TMG Gallery Total Images'); galleryTotalImage = _satellite.getVar('TMG Gallery Total Images'); pageInfo.galleryTotalImages = galleryTotalImage; } } //console.log("after gallery pgv check"); if(new RegExp(/^\/guide/).test(window.location.pathname)) { prevPage = _satellite.getVar('TMG referrerStripped'); //s.eVar168 = "guides"; lastArticleContentType = "guides"; pageInfo.lastArticleContentType = lastArticleContentType; //s.eVar170 = dataLayer.premiumPage; lastArticlePremium = dataLayer.premiumPage; pageInfo.lastArticleContentType = lastArticlePremium; //s.eVar171 = prevPage; lastArticlePrevious = prevPage; pageInfo.lastArticleContentType = lastArticlePrevious; } //s.eVar176 = 'all pages rule'; if(typeof tmg != "undefined" && tmg != "") { if(typeof tmg.guid != "undefined" && tmg.guid != ""){ //s.prop32 = tmg.guid; pageviewID = tmg.guid; pageInfo.pageViewID = pageviewID; } if(typeof window.tmg.PIANO_PAYWALL_ON != "undefined" && window.tmg.PIANO_PAYWALL_ON != ""){ //console.log(window.tmg.PIANO_PAYWALL_ON); //s.prop74 = window.tmg.PIANO_PAYWALL_ON; pianoPaywallOn = window.tmg.PIANO_PAYWALL_ON; pageInfo.pianoPaywallOn = pianoPaywallOn; } } //if(typeof dataLayer.payWall != "undefined"){ //paywallStatus = ""; //if(dataLayer.payWall == true){ //paywallStatus = "true"; //s.events = "event43"; //}else if(dataLayer.payWall == false){ //paywallStatus = "false"; //} //s.eVar43 = paywallStatus; //} //console.log("newsletter check: "+dataLayer.event); //console.log("newsletter check2: "+dataLayer.newsLetterType); //console.log("pre newsletter"); //s.prop27 = dataLayer.newsLetterType; //console.log("newslettertype: "+s.prop27); //console.log("newsletter impression for page rule1"); //function newsLetterImpression(){ //console.log("impression triggered 44444: "+dataLayer.event); //console.log("TEST NEWSLETTER IMPRESSION"); //s.prop27 = dataLayer.newsLetterType; //s.events = "event266"; //s.linkTrackEvents = "event266"; //s.linkTrackVars += 'events,' + _satellite.getVar('TMG linkTrackVars'); //} //window.tmg.pubsub.subscribe({topic:'tmg.customerApp.newsletters.pageReady', func: newsLetterImpression, runIfAlreadyPublished: true}) if(typeof dataLayer.subscription != "undefined" && dataLayer.subscription != ""){ //s.eVar61 = dataLayer.subscription.productID ? dataLayer.subscription.productID : dataLayer.subscription.productId; subscriptionProductID = dataLayer.subscription.productID ? dataLayer.subscription.productID : dataLayer.subscription.productId; pageInfo.productID = subscriptionProductID; //s.eVar62 = dataLayer.subscription.paymentPlan; subscriptionPaymentPlan = dataLayer.subscription.paymentPlan; pageInfo.subPaymentPlan = subscriptionPaymentPlan; } //fbnews //console.log("facebook news check begins"); if((document.querySelector("meta[name='fbn-bypass']"))){ fbValue = document.querySelector("meta[name='fbn-bypass']").content; if(fbValue == "true"){ //s.prop28 = "true"; facebookNews = "true"; pageInfo.facebookNews = facebookNews; } }else{ //s.prop28 = "false"; facebookNews = "false"; pageInfo.facebookNews = facebookNews; } //console.log("end of facebook news check"); //window.adobeDataLayer[0].push({ //"pageInfo":{ //"sparkInteractive": , //"expediaCheckOutDate": checkout, //"expediaTravellingFrom": airFrom, //"expediaOccupancy":fullOccupants, //"exitLink":exitLink //} //}) var subTypeExtension = _satellite.getVar('TMG Subscription Type Extension'); dimensionContainer.subscriptionList = subTypeExtension; ecid = _satellite.getVar("TMG ECID"); if(_satellite.getVar("TMG Meta Gifted") == "gifted"){ ecid = "tmg_gifted_share"; } dimensionContainer.ecid = ecid; //console.log("before final push"); //console.log(pageInfo); //console.log(webData); var lastTouchChannel = _satellite.getVar('Last Touch Marketing Channel'); var lastTouchDetail = _satellite.getVar('Last Touch Detail'); console.log('All Pages lastTouchChannel - ' + lastTouchChannel); dimensionContainer.lastTouchChannel = lastTouchChannel; dimensionContainer.lastTouchDetail = lastTouchDetail; /**console.log('TMG All Pages - dataLayer.event value: ', dataLayer.event) if (dataLayer.checkoutStep == 'One'){ pageInfo.pageName = pPathname + 'StepOne'; } else if (dataLayer.checkoutStep == 'Two'){ pageInfo.pageName = pPathname + 'StepTwo'; }**/ window.adobeDataLayer.push({ "_tmg":{ "pageInfo": pageInfo, "dimensionContainer": dimensionContainer }, "marketing":{ "trackingCode": ecid }, "web": webData }); //console.log("after final push"); }