Dai la massima visibilità
ai tuoi Annunci Immobiliari!

Finanziamo il tuo acquirente (senza interessi)

Siamo operativi in tutta Italia

The Points Guy – Maximize your travel.

[]
a / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, generateUUID);}; // Ties GAM + Cohesion, Cohesion looks for this chsn_ad_id name in the window of the page by default window.chsn_ad_id = generateUUID(); document.documentElement.className = document.documentElement.className.replace(/no-js/g, ‘js’); ]]>The Points Guy – Maximize your travel.

Advertiser Disclosure

Many of the credit card offers that appear on the website are from credit card companies from which ThePointsGuy.com receives compensation. This compensation may impact how and where products appear on this site (including, for example, the order in which they appear). This site does not include all credit card companies or all available credit card offers. Please view our advertising policy page for more information.

Editorial Note: Opinions expressed here are the author’s alone, not those of any bank, credit card issuer, airlines or hotel chain, and have not been reviewed, approved or otherwise endorsed by any of these entities.

Finanziamenti – Agevolazioni

Siamo operativi in tutta Italia

{ let mqMobile = window.matchMedia(‘(max-width: 639px)’); let mqTablet = window.matchMedia(‘(min-width: 640px) and (max-width: 1023px)’); let mqDesktop = window.matchMedia(‘(min-width: 1024px)’); // Get post info to assist in setting ptype, dfpPath, cid, and tags let post_obj = []; post_obj = {“keywords”:[“homepage”],”tags”:[],”id”:1236084,”permalink”:”https://thepointsguy.com/news/why-get-united-business-card/”}; let keywords = post_obj[‘keywords’]; let tags = post_obj[‘tags’].join(); let permalink = post_obj[‘permalink’].replace(//$/, ”); let postID = post_obj[‘id’]; //Get last section of URL to pass into cid permalink = permalink.substring(permalink.lastIndexOf(‘/’) + 1); let cid = permalink + ‘,’ + postID; let ptype = ”; // set other page ptypes switch(keywords[0]) { case ‘homepage’: ptype = ‘front_door’; break; case ‘hub.category’: ptype = ‘section_door’; break; case ‘hub.tag’: ptype = ‘section_door’; break; case ‘article’: ptype = ‘article’; break; case ‘page’: switch(keywords[1]) { // /product-reviews case ‘page-706490’: ptype = ‘section_door’; break; // /podcast case ‘page-648890’: ptype = ‘section_door_podcasts’; // inject page specific ad lib div placements let pageWrapper = document.querySelectorAll(‘.page-wrapper’)[1]; let paragraphs = pageWrapper.getElementsByTagName(‘p’); const leaderPlus = “”; const leaderboardPlus = “”; const mobileBannerPlus = “”; paragraphs[3].insertAdjacentHTML(‘afterend’, mobileBannerPlus); paragraphs[3].insertAdjacentHTML(‘afterend’, leaderboardPlus); paragraphs[3].insertAdjacentHTML(‘afterend’, leaderPlus); break; // /purposeful-travel case ‘page-562447’: ptype = ‘section_door_purposefultravel’ break; // /miles-away case ‘page-643442’: ptype = ‘list_page_podcast’; break; // /coronavirus case ‘page-900720’: ptype = ‘section_door_covid’; break; default: ptype=”section_door”; break; } break; } // set /talking-points ptype if (keywords.includes(‘page-644219’)) { ptype = ‘section_door_podcasts’; } let adUrl = new URL(window.location); if (ptype === ‘article’) { // Ensure article names aren’t included in adUrlPath adUrlPath = adUrl.pathname.split(‘/’, 2); adUrlPath = ‘/’ + adUrlPath.slice(1); // If current page is /guide article, change ptype to ‘guide’ if(adUrlPath.includes(‘guide’)) { ptype = ‘guide’; } } else if (ptype === ‘front_door’) { adUrlPath = ‘/home’; // homepage needs it’s cid set differently cid = ‘home,’ + 0; } else { adUrlPath = adUrl.pathname.replace(//$/, ”); // Update cid for category pages cid = adUrlPath.substring(adUrlPath.lastIndexOf(‘/’) + 1) + ‘,’ + postID; } const renderOnMilesAway = (adArray, device) => { let articleWrapper = document.querySelectorAll(‘.page-wrapper’)[1]; let paragraphs = articleWrapper.getElementsByTagName(‘p’); // set location to insert bottom placement ads let aboveFooter = document.querySelector(‘.above-footer’); // if mobile if ( device === ‘mobile’ ) { const mobileBannerPlus = “”; const mobileBannerPlus2 = “”; const mobileBannerPlus3 = “”; const mobileBannerPlus4 = “”; const mobileBannerPlus5 = “”; // bottom placement that needs to added programmatically to ensure ads show up in the correct order // on the Google Publisher Console extension let mobileBtmBanner = “”; // insert first ad after 3 podcasts paragraphs[8].insertAdjacentHTML(‘afterend’, mobileBannerPlus); // add new divs to array of ads that need to be rendered adArray.push([“mobile-banner-plus”, null, {pos: 1}]); // account for ad positioning let bannerCount = 2; // add ad after every 3 podcasts for ( let count = 3; count < paragraphs.length; count++ ) { if (count % 3 == 0 && bannerCount <= 5 ) { switch(bannerCount) { case 2: paragraphs[count + 11].insertAdjacentHTML('afterend', mobileBannerPlus2); adArray.push(["mobile-banner-plus", 2, {pos: 2}]); break; case 3: paragraphs[count + 14].insertAdjacentHTML('afterend', mobileBannerPlus3); adArray.push(["mobile-banner-plus", 3, {pos: 3}]); break; case 4: paragraphs[count + 17].insertAdjacentHTML('afterend', mobileBannerPlus4); adArray.push(["mobile-banner-plus", 4, {pos: 4}]); break; case 5: paragraphs[count + 20].insertAdjacentHTML('afterend', mobileBannerPlus5); adArray.push(["mobile-banner-plus", 5, {pos: 5}]); break; } bannerCount ++; } } // add bottom ad placement aboveFooter.insertAdjacentHTML('afterend', mobileBtmBanner); adArray.push("mobile-banner-bottom"); } else if ( device === 'tablet' ) { const leaderboardMiddle = ""; const leaderboardMiddle2 = ""; const leaderboardMiddle3 = ""; const leaderboardMiddle4 = ""; const leaderboardMiddle5 = ""; // bottom placement that needs to added programmatically to ensure ads show up in the correct order // on the Google Publisher Console extension let leaderboardBttm = ""; // insert first ad after 3 podcasts paragraphs[8].insertAdjacentHTML('afterend', leaderboardMiddle); // add new divs to array of ads that need to be rendered adArray.push(["leaderboard-middle", null, {pos: 'middle'}]); // account for ad positioning let bannerCount = 2; // add ad after every 3 podcasts for ( let count = 3; count < paragraphs.length; count++ ) { if (count % 3 == 0 && bannerCount <= 5 ) { switch(bannerCount) { case 2: paragraphs[count + 11].insertAdjacentHTML('afterend', leaderboardMiddle2); adArray.push(["leaderboard-middle", 2, {pos: 'middle'}]); break; case 3: paragraphs[count + 14].insertAdjacentHTML('afterend', leaderboardMiddle3); adArray.push(["leaderboard-middle", 3, {pos: 'middle'}]); break; case 4: paragraphs[count + 17].insertAdjacentHTML('afterend', leaderboardMiddle4); adArray.push(["leaderboard-middle", 4, {pos: 'middle'}]); break; case 5: paragraphs[count + 20].insertAdjacentHTML('afterend', leaderboardMiddle5); adArray.push(["leaderboard-middle", 5, {pos: 'middle'}]); break; } bannerCount ++; } } // add bottom ad placement aboveFooter.insertAdjacentHTML('afterend', leaderboardBttm); adArray.push("leaderboard-bottom"); } else if ( device === 'desktop' ) { const leaderPlusMiddle = ""; const leaderPlusMiddle2 = ""; const leaderPlusMiddle3 = ""; const leaderPlusMiddle4 = ""; const leaderPlusMiddle5 = ""; // bottom placement that needs to added programmatically to ensure ads show up in the correct order // on the Google Publisher Console extension let leaderPlusBttm = ""; // set locations to insert bottom placement ads let aboveFooter = document.querySelector('.above-footer'); // insert first ad after 3 podcasts paragraphs[8].insertAdjacentHTML('afterend', leaderPlusMiddle); // add new divs to array of ads that need to be rendered adArray.push(["leader-plus-middle", null, {pos: 'middle'}]); // account for ad positioning let bannerCount = 2; // add ad after every 3 podcasts for ( let count = 3; count < paragraphs.length; count++ ) { if (count % 3 == 0 && bannerCount { // for all right rail placements check for sidebar const articleSidebar = document.getElementsByClassName('sidebar')[0]; if (!articleSidebar) { return; } articleSidebar.classList.add('tpg-sidebar-display'); // get height of article and remove some off top for correct right rail spacing const containerHeight = document.getElementsByClassName('article-body-content')[0].offsetHeight - 700; // add height to right rail container for correct sticky behaviour document.getElementById('right-rail').style.height = `${containerHeight}px`; rightRail1 = document.getElementById('tpg_right-rail--1'); rightRail2 = document.getElementById('tpg_right-rail--2'); rightRail3 = document.getElementById('tpg_right-rail--3'); rightRail1.classList.add('sticky'); // check if article is long enough for second ad if ( containerHeight < 2000 ) { // second & third ads should always have index of 2 and 3, // but in case they don't - remove the entire div if ( adArray[2][0] === 'mpu-middle' && adArray[3][0] === 'mpu-middle' ) { adArray.splice(2, 1); adArray.splice(2, 1); } else { rightRail2.remove(); rightRail3.remove(); } return adArray; } // check article is long enough for third ad if ( containerHeight 4000) { rightRail2.classList.add('sticky'); rightRail3.classList.add('sticky'); return adArray; } }; const renderMobileAds = (adArray, ptype) => { // mobile incremental ads let mobileBannerPlus = “”; let mobileBannerPlus2 = “”; let mobileBannerPlus3 = “”; let mobileBannerPlus4 = “”; let mobileBannerPlus5 = “”; // bottom placement that needs to added programmatically to ensure ads show up in the correct order // on the Google Publisher Console extension let mobileBtmBannerArticle = “”; let mobileBtmBannerFooter = “”; // set locations to insert bottom placement ads let relatedArticles = document.querySelector(‘.related-articles’); let aboveFooter = document.querySelector(‘.above-footer’); // setting as switch for ability to add additional ptypes as needed switch(ptype) { case ‘list_page_podcast’: renderOnMilesAway(adArray, ‘mobile’); break; case ‘guide’: case ‘article’: let articleWrapper = document.querySelector(‘.beam-the-content’); let paragraphs = articleWrapper.getElementsByTagName(‘p’); paragraphs[1].insertAdjacentHTML(‘afterend’, mobileBannerPlus); // add new divs to array of ads that need to be rendered adArray.push([“mobile-banner-plus”, null, {pos: 1}]); // account for ad positioning let bannerCount = 2; // add ad after every 3 paragraphs except the 3rd one for ( let count = 2; count < paragraphs.length; count++ ) { if (count % 3 == 0 && count != 3 && bannerCount <= 5 ) { switch(bannerCount) { case 2: paragraphs[count].insertAdjacentHTML('afterend', mobileBannerPlus2); adArray.push(["mobile-banner-plus", 2, {pos: 2}]); break; case 3: paragraphs[count].insertAdjacentHTML('afterend', mobileBannerPlus3); adArray.push(["mobile-banner-plus", 3, {pos: 3}]); break; case 4: paragraphs[count].insertAdjacentHTML('afterend', mobileBannerPlus4); adArray.push(["mobile-banner-plus", 4, {pos: 4}]); break; case 5: paragraphs[count].insertAdjacentHTML('afterend', mobileBannerPlus5); adArray.push(["mobile-banner-plus", 5, {pos: 5}]); break; } bannerCount ++; } } // add bottom ad placement relatedArticles.insertAdjacentHTML('beforebegin', mobileBtmBannerArticle); adArray.push("mobile-banner-bottom"); break; case 'section_door_purposefultravel': // target first article section to append ad right after let articleSection = document.querySelectorAll('.global__container')[0]; if ( articleSection != null ) { articleSection.insertAdjacentHTML('afterend', mobileBannerPlus); adArray.push(["mobile-banner-plus", null, {pos: 1}]); } let allPosts = document.querySelectorAll('.article-block__columns--latest-feed')[0]; if ( allPosts != null ) { let articles = allPosts.getElementsByTagName('article'); // place after 5th 'All Posts' article articles[4].insertAdjacentHTML('afterend', mobileBannerPlus2); adArray.push(["mobile-banner-plus", 2, {pos: 2}]); } // add bottom ad placement aboveFooter.insertAdjacentHTML('afterend', mobileBtmBannerFooter); adArray.push("mobile-banner-bottom"); break; case 'section_door_covid': let emailCapture = document.querySelector('.phx-layout__email-capture'); if ( emailCapture != null ) { emailCapture.insertAdjacentHTML('beforebegin', mobileBannerPlus); adArray.push(["mobile-banner-plus", null, {pos: 1}]); } let allCovidPosts = document.querySelector('.phx-ag--12'); if ( allCovidPosts != null ) { let posts = allCovidPosts.getElementsByClassName('phx-ab'); // account for ad positioning let posCount = 2; // add ad after every 5 posts for ( let count = 1; count < posts.length; count++ ) { if (count % 5 == 0 && posCount { // bottom placement that needs to added programmatically to ensure ads show up in the correct order // on the Google Publisher Console extension let leaderboardBttmArticle = ""; let leaderboardBttmFooter = ""; // set locations to insert bottom placement ads let relatedArticles = document.querySelector('.related-articles'); let aboveFooter = document.querySelector('.above-footer'); // setting as switch for ability to add additional ptypes as needed switch(ptype) { case 'list_page_podcast': renderOnMilesAway(adArray, 'tablet'); break; // add incremental ads on tablet devices case 'guide': case 'article': const mpuTop = ""; const mpuMiddle = ""; const mpuBottom = ""; let articleWrapper = document.querySelector('.beam-the-content'); let paragraphs = articleWrapper.getElementsByTagName('p'); paragraphs[1].insertAdjacentHTML('afterend', mpuTop); // add new divs to array of ads that need to be rendered adArray.push("mpu-top"); // account for ad positioning let bannerCount = 2; // add ad after every 3 paragraphs, except the 3rd for ( let count = 2; count < paragraphs.length; count++ ) { if (count % 3 == 0 && count != 3 && bannerCount <= 3 ) { switch(bannerCount) { case 2: paragraphs[count].insertAdjacentHTML('afterend', mpuMiddle); // if sidebar 'mpu-middle' exists, remove it as it's only for desktop devices let rightRail2 = document.getElementById('tpg_right-rail--2'); if ( rightRail2 != null && adArray[0][0] === 'mpu-middle' ){ rightRail2.remove(); adArray.splice(0,1); } //re-add mpu-middle for tablet devices adArray.push(["mpu-middle", null, {pos:'middle'}]); break; case 3: paragraphs[count].insertAdjacentHTML('afterend', mpuBottom); adArray.push("mpu-bottom"); break; } bannerCount ++; } } // add bottom ad placement relatedArticles.insertAdjacentHTML('beforebegin', leaderboardBttmArticle); adArray.push("leaderboard-bottom"); break; case 'section_door_purposefultravel': const leaderMid = ""; // target first article section to append ad right after let articleSection = document.querySelectorAll('.global__container')[0]; if ( articleSection != null ) { articleSection.insertAdjacentHTML('afterend', leaderMid); adArray.push(["leaderboard-middle", null, {pos: 'middle'}]); } // add bottom ad placement aboveFooter.insertAdjacentHTML('afterend', leaderboardBttmFooter); adArray.push("leaderboard-bottom"); let tabletAd = document.querySelector('#leaderboard-bottom'); tabletAd.classList.add('ad-lib-div--purposeful-travel'); break; case 'section_door_covid': let lbm = ""; let emailCapture = document.querySelector('.phx-layout__email-capture'); if ( emailCapture != null ) { emailCapture.insertAdjacentHTML('beforebegin', lbm); adArray.push(["leaderboard-middle", null, {pos: 'middle'}]); } // add bottom ad placement aboveFooter.insertAdjacentHTML('afterend', leaderboardBttmFooter); adArray.push("leaderboard-bottom"); break; default: // add bottom ad placement aboveFooter.insertAdjacentHTML('afterend', leaderboardBttmFooter); adArray.push("leaderboard-bottom"); return adArray; break; } }; const renderDesktopAds = (adArray, ptype) => { // bottom placement that needs to added programmatically to ensure ads show up in the correct order // on the Google Publisher Console extension let leaderPlusBttmArticle = “”; let leaderPlusBttmFooter = “”; // set locations to insert bottom placement ads let relatedArticles = document.querySelector(‘.related-articles’); let aboveFooter = document.querySelector(‘.above-footer’); // setting as switch for ability to add additional ptypes as needed switch(ptype) { case ‘list_page_podcast’: renderOnMilesAway(adArray, ‘desktop’); break; case ‘guide’: case ‘article’: // Remove placement div from array if the article content is too short // or render ads in right rail if ptype is article renderRightRail(auctionArray, ptype); // add bottom ad placement relatedArticles.insertAdjacentHTML(‘beforebegin’, leaderPlusBttmArticle); adArray.push(“leader-plus-bottom”); break; case ‘section_door_purposefultravel’: const leaderPlusMid = “”; // target first article section to append ad right after let articleSection = document.querySelectorAll(‘.global__container’)[0]; if ( articleSection != null ) { articleSection.insertAdjacentHTML(‘afterend’, leaderPlusMid); adArray.push([“leader-plus-middle”, null, {pos: ‘middle’}]); } // add bottom ad placement aboveFooter.insertAdjacentHTML(‘afterend’, leaderPlusBttmFooter); adArray.push(“leader-plus-bottom”); let desktopAd = document.querySelector(‘#leader-plus-bottom’); desktopAd.classList.add(‘ad-lib-div–purposeful-travel’); break; case ‘section_door_covid’: let lpm = “”; let emailCapture = document.querySelector(‘.phx-layout__email-capture’); if ( emailCapture != null ) { emailCapture.insertAdjacentHTML(‘beforebegin’, lpm); adArray.push([“leader-plus-middle”, null, {pos: ‘middle’}]); } // add bottom ad placement aboveFooter.insertAdjacentHTML(‘afterend’, leaderPlusBttmFooter); adArray.push(“leader-plus-bottom”); break; default: // add bottom ad placement aboveFooter.insertAdjacentHTML(‘afterend’, leaderPlusBttmFooter); adArray.push(“leader-plus-bottom”); return adArray; break; } }; // get device config for ads set in wp admin ad lib global settings let adLibDeviceConfig = []; adLibDeviceConfig = [{“ad_lib_device”:”mobile”,”ad_lib_device_mapping”:[“mobile-omni-plus-nav”,”mobile-banner-plus”,”mobile-banner-plus2″,”mobile-banner-plus3″,”mobile-banner-plus4″,”mobile-banner-plus5″,”mobile-banner-bottom”]},{“ad_lib_device”:”tablet”,”ad_lib_device_mapping”:[“mpu-top”,”mpu-middle”,”mpu-bottom”,”omni-leaderboard-nav”,”leaderboard-middle”,”leaderboard-middle2″,”leaderboard-middle3″,”leaderboard-bottom”]},{“ad_lib_device”:”desktop”,”ad_lib_device_mapping”:[“omni-leader-plus-nav”,”mpu-plus-top”,”mpu-middle”,”mpu-middle2″,”mpu-bottom”,”leader-plus-middle”,”leader-plus-middle2″,”leader-plus-middle3″,”leader-plus-middle4″,”leader-plus-bottom”]}]; // get ad position designations set in wp admin const adLibPlacementMap = {}; const adLibPlacementConfig = [{“ad_lib_placement”:”omni-leader-plus-nav”,”ad_lib_incremental”:false,”ad_lib_increment”:””,”ad_lib_position”:”nav”},{“ad_lib_placement”:”mpu-plus-top”,”ad_lib_incremental”:false,”ad_lib_increment”:””,”ad_lib_position”:”top”},{“ad_lib_placement”:”mpu-top”,”ad_lib_incremental”:false,”ad_lib_increment”:””,”ad_lib_position”:”top”},{“ad_lib_placement”:”mpu-middle”,”ad_lib_incremental”:true,”ad_lib_increment”:”1″,”ad_lib_position”:”middle”},{“ad_lib_placement”:”mpu-middle2″,”ad_lib_incremental”:true,”ad_lib_increment”:”2″,”ad_lib_position”:”middle”},{“ad_lib_placement”:”mpu-bottom”,”ad_lib_incremental”:false,”ad_lib_increment”:””,”ad_lib_position”:”bottom”},{“ad_lib_placement”:”leader-plus-middle”,”ad_lib_incremental”:true,”ad_lib_increment”:”1″,”ad_lib_position”:”middle”},{“ad_lib_placement”:”leader-plus-middle2″,”ad_lib_incremental”:true,”ad_lib_increment”:”2″,”ad_lib_position”:”middle”},{“ad_lib_placement”:”leader-plus-middle3″,”ad_lib_incremental”:true,”ad_lib_increment”:”3″,”ad_lib_position”:”middle”},{“ad_lib_placement”:”leader-plus-middle4″,”ad_lib_incremental”:true,”ad_lib_increment”:”4″,”ad_lib_position”:”middle”},{“ad_lib_placement”:”leader-plus-bottom”,”ad_lib_incremental”:false,”ad_lib_increment”:””,”ad_lib_position”:”bottom”},{“ad_lib_placement”:”omni-leaderboard-nav”,”ad_lib_incremental”:false,”ad_lib_increment”:””,”ad_lib_position”:”nav”},{“ad_lib_placement”:”leaderboard-middle”,”ad_lib_incremental”:true,”ad_lib_increment”:”1″,”ad_lib_position”:”middle”},{“ad_lib_placement”:”leaderboard-middle2″,”ad_lib_incremental”:true,”ad_lib_increment”:”2″,”ad_lib_position”:”middle”},{“ad_lib_placement”:”leaderboard-middle3″,”ad_lib_incremental”:true,”ad_lib_increment”:”3″,”ad_lib_position”:”middle”},{“ad_lib_placement”:”leaderboard-bottom”,”ad_lib_incremental”:false,”ad_lib_increment”:””,”ad_lib_position”:”bottom”},{“ad_lib_placement”:”mobile-omni-plus-nav”,”ad_lib_incremental”:false,”ad_lib_increment”:””,”ad_lib_position”:”nav”},{“ad_lib_placement”:”mobile-banner-plus”,”ad_lib_incremental”:true,”ad_lib_increment”:”1″,”ad_lib_position”:”1″},{“ad_lib_placement”:”mobile-banner-plus2″,”ad_lib_incremental”:true,”ad_lib_increment”:”2″,”ad_lib_position”:”2″},{“ad_lib_placement”:”mobile-banner-plus3″,”ad_lib_incremental”:true,”ad_lib_increment”:”3″,”ad_lib_position”:”3″},{“ad_lib_placement”:”mobile-banner-plus4″,”ad_lib_incremental”:true,”ad_lib_increment”:”4″,”ad_lib_position”:”4″},{“ad_lib_placement”:”mobile-banner-plus5″,”ad_lib_incremental”:true,”ad_lib_increment”:”5″,”ad_lib_position”:”5″},{“ad_lib_placement”:”mobile-banner-bottom”,”ad_lib_incremental”:false,”ad_lib_increment”:””,”ad_lib_position”:”bottom”}] || []; adLibPlacementConfig.forEach(placement => { adLibPlacementMap[placement.ad_lib_placement] = placement; }); let adUnitPrefix = ‘aw’; if ( mqMobile.matches ) { adUnitPrefix = ‘maw’; } // array of divs where placements will be injected let auctionArray = []; // Get adlib divs that currently exist in the DOM const getAdLibPlacements = (deviceMap) => { let deviceArray = []; deviceMap.forEach(key => { const placement = adLibPlacementMap[key]; const incremental = placement.ad_lib_incremental; if (placement && document.getElementById(placement.ad_lib_placement)) { if (incremental) { // have to remove the trailing digit for the ad call deviceArray.push([placement.ad_lib_placement.replace(/d+$/, ”), placement.ad_lib_increment == 1 ? null : placement.ad_lib_increment, { pos: placement.ad_lib_position }]); } else { deviceArray.push(placement.ad_lib_placement); } } }); return deviceArray; }; // Loop over the ACF repeater field that has device and device mapping arrays // and set device specific auction array and prefix (if mobile) const setAuctionArray = () => { adLibDeviceConfig.forEach(config => { if ( mqMobile.matches && config.ad_lib_device == ‘mobile’ ) { auctionArray = getAdLibPlacements(config.ad_lib_device_mapping); //render incremental ads specific to device type renderMobileAds(auctionArray, ptype); } if (mqTablet.matches && config.ad_lib_device == ‘tablet’ ) { auctionArray = getAdLibPlacements(config.ad_lib_device_mapping); renderTabletAds(auctionArray, ptype); } if ( mqDesktop.matches && config.ad_lib_device == ‘desktop’ ) { auctionArray = getAdLibPlacements(config.ad_lib_device_mapping); renderDesktopAds(auctionArray, ptype); } }); return auctionArray; }; // Helper fxn for fixed ads on nav ad placements // @TODO – depending on decisions surrounding UX this may be removed/uncommented // const isInViewport = (elem) => { // const headerNav = document.querySelector(‘.header-nav’); // const sentinel = document.createElement(‘div’); // headerNav.before(sentinel); // const observer = new IntersectionObserver(entries => { // entries.forEach(entry => { // if (entry.boundingClientRect.y { // elem.classList.remove(‘ad-lib-div–fixed’); // sentinel.remove(); // }, 3000); // } // }); // }); // observer.observe(sentinel); // }; // Bidbarrel bootstrap var immediateUseAdLibFunctions = [‘auction’, ‘initialize’, ‘on’]; (function(a){ var w=window,b=’BidBarrel’,q=’queue’;w[b]=w[b]?w[b]:{};w[b][q]=w[b][q]?w[b][q]:[]; a.forEach(function(z){w[b][z]=w[b][z]||function(){var c=arguments;w[b][q].push(function(r){w[b][z].apply(w[b],c);r()})}}); })(immediateUseAdLibFunctions); BidBarrel.initialize({ dfpPath: “/22309610186/” + adUnitPrefix + “-tpg” + adUrlPath, targeting: { auto: true, cookie: { surround: true, consolidate: true } }, pageTargeting: { ptype: ptype, env: “prod”, vguid: window.chsn_ad_id, cid: cid, topic: tags, } }); BidBarrel.auction(setAuctionArray()); //console.log(auctionArray); BidBarrel.on(“rendered”, function(unitConfig, gptEventObj) { //console.log(unitConfig); // Target rendered Ad const { code } = unitConfig; const { targeting } = unitConfig; const { size } = gptEventObj; const adWidth = size[0]; const adHeight = size[1]; // Ad element + position const ad = document.getElementById(code); const pos = targeting.pos; // ad unit rendered ad.classList.add(‘ad-lib-div–rendered’); let adSizeClass = ‘ad-lib-div–‘ + adWidth + ‘x’ + adHeight; ad.classList.add(adSizeClass); // ad unit is empty after rendering if (gptEventObj.isEmpty) { ad.classList.add(‘ad-lib-div–empty’); } // Add ‘ADVERTISEMENT’ text ad.insertAdjacentHTML(‘afterbegin’, ‘ADVERTISEMENT’); // Add fixed functionality to nav placements of a certain height // @TODO – depending on decisions surrounding UX this may be removed/uncommented // if ( pos === ‘nav’ && (adHeight === 66 || adHeight === 90) ) { // isInViewport(ad); // } console.log(code); // add addtl classes post render based on ptype switch (ptype) { // add width override for ads on desktop/tablet article pages case ‘article’: case ‘guide’: if ( ( adWidth === 728 || adWidth === 970 ) ) { switch (code) { case ‘leader-plus-bottom’: case ‘leader-plus-middle’: case ‘leaderboard-bottom’: ad.classList.add(‘ad-lib-div–‘+ adWidth + ‘-override’); break; } } break; // add margin-top override to account for weird spacing on /podcasts case ‘section_door_podcasts’: if ( (code === ‘leader-plus-bottom’ || code === ‘leaderboard-bottom’) && adUrlPath === ‘/podcast’) { ad.classList.add(‘ad-lib-div–margin-override’); } break; case ‘section_door_purposefultravel’: switch (code) { case ‘leader-plus-bottom’: case ‘leaderboard-bottom’: ad.classList.add(‘ad-lib-div–purposeful-travel’); break; } break; } // add styling class for /tag mobile ad placement if ( adUrlPath.includes(‘tag’) && code === ‘mobile-banner-plus2’ ) { ad.classList.remove(‘ad-lib-div–latest-feed’); ad.classList.add(‘ad-lib-div–hub-tag’); } }); // Returns a function, that, as long as it continues to be invoked, will not // be triggered. The function will be called after it stops being called for // N milliseconds. If `immediate` is passed, trigger the function on the // leading edge, instead of the trailing. // @CREDIT: https://davidwalsh.name/javascript-debounce-function function debounce(func, wait, immediate) { var timeout; return function() { var context = this, args = arguments; var later = function() { timeout = null; if (!immediate) func.apply(context, args); }; var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (callNow) func.apply(context, args); }; }; // Store the window width let windowWidth = window.innerWidth; // add a class on resize so we can target with css window.addEventListener(‘resize’, debounce(() => { // Check window width has actually changed and it’s not just iOS triggering a resize event on scroll if (window.innerWidth != windowWidth) { // Update the window width for next time windowWidth = window.innerWidth // clear existing slots to prepare for new auction BidBarrel.clearSlots(auctionArray); // auction new slots with divs for current window size BidBarrel.auction(setAuctionArray()); } }), 250); })(); ]]>

Source

“https://thepointsguy.com/”

Pubblichiamo solo i migliori articoli della rete. Clicca qui per visitare il sito di provenienza. SITE: the best of the best ⭐⭐⭐⭐⭐
Clicca qui

La rete Adessonews è un aggregatore di news e replica gli articoli senza fini di lucro ma con finalità di critica, discussione od insegnamento, come previsto dall’art. 70 legge sul diritto d’autore e art. 41 della costituzione Italiana. Al termine di ciascun articolo è indicata la provenienza dell’articolo. Per richiedere la rimozione dell’articolo clicca qui

Finanziamo i tuo immobile

anche con procedure in corso

Siamo operativi in tutta Italia
Si convenzionano agenzie immobiliari

Mutui anche per liquidità

Siamo operativi in tutta Italia

La rete Adessonews è un aggregatore di news e replica gli articoli senza fini di lucro ma con finalità di critica, discussione od insegnamento,

come previsto dall’art. 70 legge sul diritto d’autore e art. 41 della costituzione Italiana. Al termine di ciascun articolo è indicata la provenienza dell’articolo.

Per richiedere la rimozione dell’articolo clicca qui

%d blogger hanno fatto clic su Mi Piace per questo: