Canada Or USA: Which Country Is Larger In Terms Of *Land* Area (Excluding Water) ? - Flytrippers (2023)

`;}//Define the get cookie functionfunction getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; }//For values with 4 digits/*function numberWithCommasSpaces(x,lang) { if (lang === 'fr'){ //return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " "); //Do nothing, no space } else { return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); //Do nothing, no , }}*/var PageLang = document.documentElement.lang.substring(0,2); //fr,enif (!PageLang){ //use cookie if nothing here var PageLang = getCookie("pll_language"); //fr,en}var userCountry = getCookie("FlytrippersCountryAssumed");//CA,US,FR//Only show our custom ads to user in Canadaif (userCountry === 'CA'){ //Get the data from the JSON var possibleAds = {"webinar": {"template": "ads", "adImg": "https://img.flytrippers.com/wp-content/uploads/2022/07/18143335/webinar_icon_flytrippers.png", "goUrl": "https://flytrippers.com/travel-rewards-webinar-december-2021/", "txt": "Are you curious to see how we use travel rewards to earn hundreds of dollars in free travel each year?", "buttonTxt": "I want to know how \u276f", "adImgFr": "https://img.flytrippers.com/wp-content/uploads/2022/07/18143335/webinar_icon_flytrippers.png", "goUrlFr": "https://flytrippers.com/fr/webinaire-recompenses-voyage-decembre-2021/", "txtFr": "Tu veux savoir comment on accumule des centaines de dollars en voyages gratuits chaque ann\u00e9e gr\u00e2ce aux r\u00e9compenses-voyage ?", "buttonTxtFr": "OUI ! \u276f", "fValueType": "", "fValue": "", "hideAllAds": "N", "limitedArea": ""}, "coblaltFlorida": {"template": "card", "adImg": "https://img.flytrippers.com/wp-content/uploads/2021/08/16143246/american-express-cobalt-card.jpg", "goUrl": "https://flytrippers.com/american-express-cobalt-card-review/", "txt": "Book this deal or get 4 roundtrip flights to Florida with the Amex Cobalt welcome bonus!", "buttonTxt": "I want to know how \u276f", "adImgFr": "https://img.flytrippers.com/wp-content/uploads/2021/08/16143239/carte-cobalt-american-express.jpg", "goUrlFr": "https://flytrippers.com/fr/review-carte-american-express-cobalt/", "txtFr": "Tu peux prendre ce deal et/ou obtenir 4 vols aller-retour vers la Floride avec une seule prime de bienvenue!", "buttonTxtFr": "Je veux savoir comment \u276f", "fValueType": "\u2248", "fValue": 744, "hideAllAds": "N", "limitedArea": ""}, "marriottLPorderNow": {"template": "cardorder", "adImg": "https://img.flytrippers.com/wp-content/uploads/2021/01/19114420/marriott-bonvoy-american-express-card.png", "goUrl": "https://flytrippers.com/go/amex-marriott.php", "txt": "Get this card's welcome bonus and start earning points now!", "buttonTxt": "Apply now \u276f", "adImgFr": "https://img.flytrippers.com/wp-content/uploads/2021/01/21223507/carte-marriott-bonvoy-american-express.png", "goUrlFr": "https://flytrippers.com/go/amex-marriott_fr.php", "txtFr": "Obtiens cette prime de bienvenue et commence \u00e0 accumuler des points maintenant!", "buttonTxtFr": "Demande la carte \u276f", "fValueType": "\u2248", "fValue": 357, "hideAllAds": "N", "limitedArea": ""}, "goldLPorderNow": {"template": "cardorder", "adImg": "https://img.flytrippers.com/wp-content/uploads/2021/09/21142200/american-express-gold-rewards-card.png", "goUrl": "https://flytrippers.com/go/amex-gold.php", "txt": "Get this card's welcome bonus and start earning points now!", "buttonTxt": "Apply now \u276f", "adImgFr": "https://img.flytrippers.com/wp-content/uploads/2021/09/21142206/carte-or-avec-primes-american-express.png", "goUrlFr": "https://flytrippers.com/go/amex-gold_fr.php", "txtFr": "Obtiens cette prime de bienvenue et commence \u00e0 accumuler des points maintenant!", "buttonTxtFr": "Demande la carte \u276f", "fValueType": "\u2248", "fValue": 495, "hideAllAds": "N", "limitedArea": ""}, "platinumLPorderNow": {"template": "cardorder", "adImg": "https://img.flytrippers.com/wp-content/uploads/2021/01/20123624/platinum-card-american-express.png", "goUrl": "https://flytrippers.com/go/amex-platinum.php", "txt": "Get this card's welcome bonus and start earning points now!", "buttonTxt": "Apply now \u276f", "adImgFr": "https://img.flytrippers.com/wp-content/uploads/2021/01/21223454/carte-de-platine-american-express.png", "goUrlFr": "https://flytrippers.com/go/amex-platinum_fr.php", "txtFr": "Obtiens cette prime de bienvenue et commence \u00e0 accumuler des points maintenant!", "buttonTxtFr": "Demande la carte \u276f", "fValueType": "\u2248", "fValue": 491, "hideAllAds": "N", "limitedArea": ""}, "aeroplanLPorderNow": {"template": "cardorder", "adImg": "https://img.flytrippers.com/wp-content/uploads/2021/01/19113318/american-express-aeroplan-card.png", "goUrl": "https://flytrippers.com/go/amex-aeroplan.php", "txt": "Get this card's welcome bonus and start earning points now!", "buttonTxt": "Apply now \u276f", "adImgFr": "https://img.flytrippers.com/wp-content/uploads/2021/01/21223540/carte-aeroplan-american-express.png", "goUrlFr": "https://flytrippers.com/go/amex-aeroplan_fr.php", "txtFr": "Obtiens cette prime de bienvenue et commence \u00e0 accumuler des points maintenant!", "buttonTxtFr": "Demande la carte \u276f", "fValueType": "\u2248", "fValue": 675, "hideAllAds": "N", "limitedArea": ""}, "reserveLPorderNow": {"template": "cardorder", "adImg": "https://img.flytrippers.com/wp-content/uploads/2021/01/20122352/american-express-aeroplan-reserve-card.png", "goUrl": "https://flytrippers.com/go/amex-aeroplan-reserve.php", "txt": "Get this card's welcome bonus and start earning points now!", "buttonTxt": "Apply now \u276f", "adImgFr": "https://img.flytrippers.com/wp-content/uploads/2021/01/21223525/carte-prestige-aeroplan-american-express.png", "goUrlFr": "https://flytrippers.com/go/amex-aeroplan-reserve_fr.php", "txtFr": "Obtiens cette prime de bienvenue et commence \u00e0 accumuler des points maintenant!", "buttonTxtFr": "Demande la carte \u276f", "fValueType": "\u2248", "fValue": 789, "hideAllAds": "N", "limitedArea": ""}, "hsbcLPorderNow": {"template": "cardorder", "adImg": "https://img.flytrippers.com/wp-content/uploads/2021/01/20122519/hsbc-world-elite-mastercard.jpg", "goUrl": "https://flytrippers.com/go/hsbc-world-elite.php", "txt": "Get this card's welcome bonus and start earning points now!", "buttonTxt": "Apply now \u276f", "adImgFr": "https://img.flytrippers.com/wp-content/uploads/2021/02/13174541/carte-mastercard-hsbc-world-elite.jpg", "goUrlFr": "https://flytrippers.com/go/hsbc-world-elite_fr.php", "txtFr": "Obtiens cette prime de bienvenue et commence \u00e0 accumuler des points maintenant!", "buttonTxtFr": "Demande la carte \u276f", "fValueType": "\u2248", "fValue": 639, "hideAllAds": "N", "limitedArea": ""}, "hsbcQcLPorderNow": {"template": "cardorder", "adImg": "https://img.flytrippers.com/wp-content/uploads/2021/01/20122519/hsbc-world-elite-mastercard.jpg", "goUrl": "https://flytrippers.com/go/hsbc-world-elite.php", "txt": "Get this card's welcome bonus and start earning points now!", "buttonTxt": "Apply now \u276f", "adImgFr": "https://img.flytrippers.com/wp-content/uploads/2021/02/13174541/carte-mastercard-hsbc-world-elite.jpg", "goUrlFr": "https://flytrippers.com/go/hsbc-world-elite_fr.php", "txtFr": "Obtiens cette prime de bienvenue et commence \u00e0 accumuler des points maintenant!", "buttonTxtFr": "Demande la carte \u276f", "fValueType": "\u2248", "fValue": 562, "hideAllAds": "N", "limitedArea": ""}, "avionLPorderNow": {"template": "cardorder", "adImg": "https://img.flytrippers.com/wp-content/uploads/2022/03/30223905/rbc-avion-visa-infinite-card.png", "goUrl": "https://flytrippers.com/go/rbc-avion-infinite.php", "txt": "Get this card's welcome bonus and start earning points now!", "buttonTxt": "Apply now \u276f", "adImgFr": "https://img.flytrippers.com/wp-content/uploads/2022/03/30223907/carte-avion-visa-infinite-rbc.png", "goUrlFr": "https://flytrippers.com/go/rbc-avion-infinite_fr.php", "txtFr": "Obtiens cette prime de bienvenue et commence \u00e0 accumuler des points maintenant!", "buttonTxtFr": "Demande la carte \u276f", "fValueType": "\u2248", "fValue": 780, "hideAllAds": "N", "limitedArea": ""}, "CobaltLPApplyNow": {"template": "cardorder", "adImg": "https://img.flytrippers.com/wp-content/uploads/2021/08/16143246/american-express-cobalt-card.jpg", "goUrl": "https://flytrippers.com/go/amex-cobalt.php", "txt": "Get this card's welcome bonus and start earning points now!", "buttonTxt": "Apply now \u276f", "adImgFr": "https://img.flytrippers.com/wp-content/uploads/2021/08/16143239/carte-cobalt-american-express.jpg", "goUrlFr": "https://flytrippers.com/go/amex-cobalt_fr.php", "txtFr": "Obtiens cette prime de bienvenue et commence \u00e0 accumuler des points maintenant!", "buttonTxtFr": "Demande la carte \u276f", "fValueType": "\u2248", "fValue": 744, "hideAllAds": "N", "limitedArea": ""}, "britAirwaysLPorderNow": {"template": "cardorder", "adImg": "https://img.flytrippers.com/wp-content/uploads/2021/09/01115541/rbc-british-airways-visa-infinite-card.png", "goUrl": "", "txt": "Get this card's welcome bonus and start earning points now!", "buttonTxt": "Apply now \u276f", "adImgFr": "https://img.flytrippers.com/wp-content/uploads/2021/09/01115555/carte-visa-infinite-british-airways-rbc.png", "goUrlFr": "", "txtFr": "Obtiens cette prime de bienvenue et commence \u00e0 accumuler des points maintenant!", "buttonTxtFr": "Demande la carte \u276f", "fValueType": "\u2248", "fValue": 675, "hideAllAds": "N", "limitedArea": ""}, "edgeLPorderNow": {"template": "cardorder", "adImg": "https://img.flytrippers.com/wp-content/uploads/2021/01/20122405/american-express-business-edge-card.gif", "goUrl": "https://flytrippers.com/go/amex-edge-business.php", "txt": "Get this card's welcome bonus and start earning points now!", "buttonTxt": "Apply now \u276f", "adImgFr": "https://img.flytrippers.com/wp-content/uploads/2021/01/21223500/carte-entreprise-edge-american-express.gif", "goUrlFr": "https://flytrippers.com/go/amex-edge-business_fr.php", "txtFr": "Obtiens cette prime de bienvenue et commence \u00e0 accumuler des points maintenant!", "buttonTxtFr": "Demande la carte \u276f", "fValueType": "\u2248", "fValue": 651, "hideAllAds": "N", "limitedArea": ""}, "scotiaPlatLPorderNow": {"template": "cardorder", "adImg": "https://img.flytrippers.com/wp-content/uploads/2022/07/20143348/scotiabank-platinum-american-express-card.png", "goUrl": "https://flytrippers.com/go/scotia-platinum.php", "txt": "Get this card's welcome bonus and start earning points now!", "buttonTxt": "Apply now \u276f", "adImgFr": "https://img.flytrippers.com/wp-content/uploads/2022/07/20143243/carte-platine-scotia-american-express.png", "goUrlFr": "https://flytrippers.com/go/scotia-platinum_fr.php", "txtFr": "Obtiens cette prime de bienvenue et commence \u00e0 accumuler des points maintenant!", "buttonTxtFr": "Demande la carte \u276f", "fValueType": "=", "fValue": 161, "hideAllAds": "N", "limitedArea": ""}}; console.log(possibleAds); //Define the possible cards - Migrate to Google Sheet for ease of creation - This format: /*var possibleAds = { "marriottOrderNow": { "template": "cardorder", "adImg": "https://img.flytrippers.com/wp-content/uploads/2021/01/19114420/marriott-bonvoy-american-express-card.png", "goUrl": "https://flytrippers.com/go/amex-marriott.php", "txt": "Increased offer ends May 11th, one of the best ever seen!", "buttonTxt": "Apply now \u276f", "adImgFr": "https://img.flytrippers.com/wp-content/uploads/2021/01/21223507/carte-marriott-bonvoy-american-express.png", "goUrlFr": "https://flytrippers.com/go/amex-marriott_fr.php", "txtFr": "Offre am\u00e9lior\u00e9e prend fin le 11 mai, une des meilleures jamais vues!", "buttonTxtFr": "Demande la carte \u276f", "fValueType": "\u2248", "fValue": 592, "hideAllAds": "N", "limitedArea": "", "onURLs":["https://flytrippers.com/fr/meilleures-cartes-de-credit/carte-marriott-bonvoy-american-express/","https://flytrippers.com/best-credit-cards-canada/marriott-bonvoy-american-express-card/"] }}*/ //TEMP - URL where we activated this script for now var marriottOrder = ['https://flytrippers.com/marriott-bonvoy-american-express-benefits/','https://flytrippers.com/fr/marriott-bonvoy-american-express-avantages/','https://flytrippers.com/best-credit-cards-canada/marriott-bonvoy-american-express-card/','https://flytrippers.com/fr/meilleures-cartes-de-credit/carte-marriott-bonvoy-american-express/','https://flytrippers.com/fr/comment-obtenir-17-nuits-dans-de-beaux-hotels-pour-120-dollars/','https://flytrippers.com/how-to-get-17-nights-in-beautiful-hotels-for-120/']; var mapArticles = ['https://flytrippers.com/countries-canadians-can-travel-to/','https://flytrippers.com/fr/pays-ou-les-canadiens-peuvent-voyager/']; var japanItinerary = ['https://flytrippers.com/fr/itineraire-voyage-2-semaines-japon/'] var aeroplanUsage = ['https://flytrippers.com/fr/bons-usages-points-aeroplan/','https://flytrippers.com/good-uses-aeroplan-points/'] var marriottAndFlights = ['https://flytrippers.com/fr/exemples-marriott-aeroplan/','https://flytrippers.com/examples-marriott-aeroplan/'] var sameOrderPostId = [28465,28679,57526,57695,57010,59269] //last 2 are only for testing //var webinar = ['https://flytrippers.com/live-events/','https://flytrippers.com/fr/evenements-en-direct/'] //var webinar = ['https://flytrippers.com/best-credit-cards-canada/','https://flytrippers.com/fr/meilleures-cartes-de-credit/'] //Uncomment before (to only leave on the french one) //var webinar = ['https://flytrippers.com/fr/meilleures-cartes-de-credit/'] var webinar = [] var cobaltAdsURLs = ['https://flytrippers.com/fr/meilleures-cartes-de-credit/carte-cobalt-american-express/','https://flytrippers.com/fr/review-carte-american-express-cobalt/','https://flytrippers.com/fr/bons-usages-points-aeroplan/','https://flytrippers.com/fr/bons-usages-points-amex/','https://flytrippers.com/fr/bons-usages-points-avios/','https://flytrippers.com/fr/base-recompenses-voyage/','https://flytrippers.com/travel-rewards-basics/','https://flytrippers.com/11-good-uses-of-avios-points/','https://flytrippers.com/good-uses-aeroplan-points/','https://flytrippers.com/good-uses-amex-points/','https://flytrippers.com/american-express-cobalt-card-review/','https://flytrippers.com/best-credit-cards-canada/american-express-cobalt-card/','https://flytrippers.com/american-express-cobalt-card-summary/','https://flytrippers.com/fr/carte-american-express-cobalt-resume/'] //TEMP - dealRegion with possible ads //,'Florida' var dealRegionWithAds = ['Spain','South Africa','Indonesia','India','Malaysia','Florida']; //TEMP RESET ALL TO REMOVE ADHESION FOR NOW mapArticles = [] japanItinerary = [] aeroplanUsage = [] aeroplanUsage = [] marriottAndFlights = [] sameOrderPostId = [] cobaltAdsURLs = [] cobaltOrder = ['https://flytrippers.com/best-credit-cards-canada/american-express-cobalt-card/','https://flytrippers.com/fr/meilleures-cartes-de-credit/carte-cobalt-american-express/','https://flytrippers.com/american-express-cobalt-card-review/','https://flytrippers.com/fr/review-carte-american-express-cobalt/','https://flytrippers.com/american-express-cobalt-card-summary/','https://flytrippers.com/fr/carte-american-express-cobalt-resume/'] platinumOrder = ['https://flytrippers.com/best-credit-cards-canada/platinum-card-from-american-express/','https://flytrippers.com/fr/meilleures-cartes-de-credit/carte-platine-american-express/','https://flytrippers.com/fr/carte-platine-amex-vs-carte-prestige-aeroplan-amex/','https://flytrippers.com/amex-platinum-card-vs-amex-aeroplan-reserve-card/','https://flytrippers.com/american-express-platinum-card-benefits/','https://flytrippers.com/fr/avantages-carte-platine-american-express/'] reserveOrder = ['https://flytrippers.com/best-credit-cards-canada/american-express-aeroplan-reserve-card/','https://flytrippers.com/fr/meilleures-cartes-de-credit/carte-prestige-aeroplan-american-express/'] aeroplanOrder = ['https://flytrippers.com/best-credit-cards-canada/american-express-aeroplan-card/','https://flytrippers.com/fr/meilleures-cartes-de-credit/carte-aeroplan-american-express/','https://flytrippers.com/fr/bons-usages-points-aeroplan/','https://flytrippers.com/good-uses-aeroplan-points/','https://flytrippers.com/fr/avantages-carte-aeroplan-american-express/','https://flytrippers.com/benefits-american-express-aeroplan-card/','https://flytrippers.com/american-express-aeroplan-card-benefits/'] goldOrder = ['https://flytrippers.com/best-credit-cards-canada/american-express-gold-rewards-card/','https://flytrippers.com/fr/meilleures-cartes-de-credit/carte-or-primes-american-express/','https://flytrippers.com/good-uses-amex-points/','https://flytrippers.com/fr/bons-usages-points-amex/','https://flytrippers.com/fr/avantages-carte-or-american-express/','https://flytrippers.com/benefits-american-express-gold-card/','https://flytrippers.com/fr/carte-or-amex-vs-carte-aeroplan-amex/','https://flytrippers.com/amex-gold-card-vs-amex-aeroplan-card/','https://flytrippers.com/american-express-gold-card-benefits/'] hsbcOrder = ['https://flytrippers.com/best-credit-cards-canada/hsbc-world-elite-mastercard/'] hsbcQcOrder = ['https://flytrippers.com/fr/meilleures-cartes-de-credit/carte-mastercard-hsbc-world-elite/'] avionOrder = ['https://flytrippers.com/best-credit-cards-canada/rbc-avion-visa-infinite-card/','https://flytrippers.com/fr/meilleures-cartes-de-credit/carte-avion-visa-infinite-rbc/'] britAirwaysOrder = ['https://flytrippers.com/best-credit-cards-canada/rbc-british-airways-visa-infinite-card/','https://flytrippers.com/fr/meilleures-cartes-de-credit/carte-visa-infinite-british-airways-rbc/'] edgeOrder = ['https://flytrippers.com/best-credit-cards-canada/american-express-business-edge-card/','https://flytrippers.com/fr/meilleures-cartes-de-credit/carte-entreprise-edge-american-express/'] marriottOrder = ['https://flytrippers.com/fr/meilleures-cartes-de-credit/carte-marriott-bonvoy-american-express/','https://flytrippers.com/best-credit-cards-canada/marriott-bonvoy-american-express-card/','https://flytrippers.com/marriott-bonvoy-american-express-benefits/','https://flytrippers.com/fr/marriott-bonvoy-american-express-avantages/'] scotiaPlatOrder = ['https://flytrippers.com/best-credit-cards-canada/scotiabank-platinum-american-express-card/','https://flytrippers.com/fr/meilleures-cartes-de-credit/carte-platine-scotia-american-express/'] //Remove expired amex offers /*cobaltOrder = [] platinumOrder = [] reserveOrder = [] aeroplanOrder = [] goldOrder = [] edgeOrder = [] */ //Check if we are on a deal or not, if not reset dealRegion and areaName if (typeof dealRegion == 'undefined') { dealRegion = ''; } if (typeof areaName == 'undefined'){ areaName = ''; } console.log('dealRegion: '+dealRegion); console.log('areaName: '+areaName); /* Ads creation */ //Determine which ads to show - Get the content of the cookie & the current url //var currentURL = window.location.href; //Remove the url parameters or it wont work with FB or when adding internal links (#) var currentURL = window.location.href.split('?')[0]; var currentURL = currentURL.split('#')[0]; //console.log('currentURL: '+currentURL); //Start with the Cobalt ads, first in the list have priority if (cobaltOrder.includes(currentURL)){ var possibleAdsKey = 'CobaltLPApplyNow'; //If we are on a marriott page, use the order card now ads } else if (marriottOrder.includes(currentURL)){ var possibleAdsKey = 'marriottLPorderNow'; } else if (mapArticles.includes(currentURL)){ var allPossibleAdsKey = ["marriottMapCountry","marriottFOMOMapCountry","marriottnightsMapCountry","marriottallMapCountry","marriottDYKMapCountry","marriottsavvyMapCountry","marriottbestMapCountry","marriottSimpleMapCountry","marriottShouldMapCountry","aeroplanMapCountry","aeroplanHundredsMapCountry","reserveptsMapCountry","reserveMapCountry","PlatinumMapCountry"]; var possibleAdsKey = allPossibleAdsKey[Math.floor(Math.random() * allPossibleAdsKey.length)]; //var possibleAdsKey = 'marriottMapCountry'; var adVersion = possibleAdsKey; } else if (japanItinerary.includes(currentURL)){ var possibleAdsKey = 'JapanItinerary'; } else if (aeroplanUsage.includes(currentURL)){ var possibleAdsKey = 'AeroplanUses'; } else if (marriottAndFlights.includes(currentURL)){ var possibleAdsKey = 'AeroplanUses'; } else if (dealRegionWithAds.includes(dealRegion)) { //Deals to specific region should be shown specific ads if (dealRegion == 'Spain'){ var possibleAdsKey = 'spainDeals'; } else if (dealRegion == 'South Africa'){ var possibleAdsKey = 'southAfricaDeals'; } else if (dealRegion == 'Indonesia'){ var possibleAdsKey = 'indonesiaDeals'; } else if (dealRegion == 'India'){ var possibleAdsKey = 'indiaDeals'; } else if (dealRegion == 'Malaysia'){ var possibleAdsKey = 'malaysiaDeals'; //} else if (dealRegion == 'Florida' && (areaName == 'Montreal' || areaName == 'Toronto')){ //var possibleAdsKey = 'aeroplanMapCountry'; //var possibleAdsKey = 'coblaltFlorida'; } } else if (goldOrder.includes(currentURL)){ var possibleAdsKey = 'goldLPorderNow'; } else if (platinumOrder.includes(currentURL)){ var possibleAdsKey = 'platinumLPorderNow'; } else if (aeroplanOrder.includes(currentURL)){ var possibleAdsKey = 'aeroplanLPorderNow'; } else if (reserveOrder.includes(currentURL)){ var possibleAdsKey = 'reserveLPorderNow'; } else if (edgeOrder.includes(currentURL)){ var possibleAdsKey = 'edgeLPorderNow'; } else if (hsbcOrder.includes(currentURL)){ var possibleAdsKey = 'hsbcLPorderNow'; } else if (hsbcQcOrder.includes(currentURL)){ var possibleAdsKey = 'hsbcQcLPorderNow'; } else if (avionOrder.includes(currentURL)){ var possibleAdsKey = 'avionLPorderNow'; } else if (britAirwaysOrder.includes(currentURL)){ var possibleAdsKey = 'britAirwaysLPorderNow'; } else if (scotiaPlatOrder.includes(currentURL)){ var possibleAdsKey = 'scotiaPlatLPorderNow'; } else if (webinar.includes(currentURL)){ var possibleAdsKey = 'webinar'; } else { //User not on a marriot page (but this script is on the page somehow - impossible for now!) //var possibleAdsKey = 'ranking'; //Fallback as don't show anything document.getElementById("customFtAds").style.display = "none"; var possibleAdsKey = ''; //Fallback show webinar everywhere //var possibleAdsKey = 'webinarPopup'; } //Create the ads console.log('possibleAdsKey: '+possibleAdsKey); var limitedAreaByPass = 1; //Check that the key exist and if we are limiting by area if (possibleAdsKey == '' || typeof possibleAdsKey == 'undefined' || typeof possibleAds[possibleAdsKey]['limitedArea'] == 'undefined'){ //Hide ad document.getElementById("customFtAds").style.display = "none"; } else { if (possibleAds[possibleAdsKey]['limitedArea'] !== ""){ //Asign first 3 letter of the FlytrippersCity & FlytrippersCityAssumed cookies (if set) to JS variables (don't need language here, remove F if present) var FlytrippersCity = getCookie("FlytrippersCity").substring(0,3); //Use the cookie we've defined if not given by the users var FlytrippersCityAssumed = getCookie("FlytrippersCityAssumed").substring(0,3); if (FlytrippersCity !== ""){ var userAbvOut = FlytrippersCity; } else if (FlytrippersCityAssumed !== "") { var userAbvOut = FlytrippersCityAssumed; } else { var userAbvOut = ""; } //Get the limited area var limitedArea = possibleAds[possibleAdsKey]['limitedArea']; console.log('limitedArea: '+limitedArea); console.log(typeof limitedArea); console.log('userAbvOut: '+userAbvOut); console.log(!limitedArea.includes(userAbvOut)) //Don't show the ads if we are limiting the area and not in the limitation if (!limitedArea.includes(userAbvOut)){ console.log('IM IN') //User not within the limited area, show regular mediavine ads document.getElementById("customFtAds").style.display = "none"; //Make sure we do not run the next var limitedAreaByPass = 0; } console.log('limitedAreaByPass: '+limitedAreaByPass); } } console.log('limitedAreaByPass: '+limitedAreaByPass); //Not limiting the area or area within the limited ones, make sure the key exist to continue if (possibleAdsKey != '' && limitedAreaByPass == 1){ //Hide mediavine adhesion ads here + Check if we add all ads (hacking blog) vs hide only adhesion ad if (possibleAds[possibleAdsKey]['hideAllAds'] == "Y"){ document.getElementById("ads-blacklist-container").innerHTML = '

'; } else { document.getElementById("ads-blacklist-container").innerHTML = '

'; } //Define the variables using the correct ad key var template = possibleAds[possibleAdsKey]['template']; //Generic every ads if (PageLang === 'fr'){ var imageAds = possibleAds[possibleAdsKey]['adImgFr']; var imageTxt = possibleAds[possibleAdsKey]['txtFr']; var imageButtonTxt = possibleAds[possibleAdsKey]['buttonTxtFr']; var goUrl = possibleAds[possibleAdsKey]['goUrlFr']; } else { var imageAds = possibleAds[possibleAdsKey]['adImg']; var imageTxt = possibleAds[possibleAdsKey]['txt']; var imageButtonTxt = possibleAds[possibleAdsKey]['buttonTxt']; var goUrl = possibleAds[possibleAdsKey]['goUrl']; } //Only card ads if (template === 'cardorder' || template === 'card'){ if (PageLang === 'fr'){ var logoValTxt = 'Valorisation Canada Or USA: Which Country Is Larger In Terms Of *Land* Area (Excluding Water) ? - Flytrippers (2)'; //var fValuation = possibleAds[possibleAdsKey]['fValueType']+' '+numberWithCommasSpaces(possibleAds[possibleAdsKey]['fValue'],PageLang)+'$'; var fValuation = possibleAds[possibleAdsKey]['fValueType']+' '+possibleAds[possibleAdsKey]['fValue']+'$'; var tandC = "Des conditions s'appliquent"; } else { var logoValTxt = 'Canada Or USA: Which Country Is Larger In Terms Of *Land* Area (Excluding Water) ? - Flytrippers (3) Valuation'; //var fValuation = possibleAds[possibleAdsKey]['fValueType']+' $'+numberWithCommasSpaces(possibleAds[possibleAdsKey]['fValue'],PageLang); var fValuation = possibleAds[possibleAdsKey]['fValueType']+' $'+possibleAds[possibleAdsKey]['fValue']; var tandC = "Terms and conditions apply"; } } //Change the image if (template === 'cardorder' || template === 'card'){ document.getElementById("ftAdsImgContainer").innerHTML = 'Canada Or USA: Which Country Is Larger In Terms Of *Land* Area (Excluding Water) ? - Flytrippers (4)

'+logoValTxt+' '+fValuation+'
'+tandC+'

Canada Or USA: Which Country Is Larger In Terms Of *Land* Area (Excluding Water) ? - Flytrippers (5)

'; } else { document.getElementById("ftAdsImgContainer").innerHTML = 'Canada Or USA: Which Country Is Larger In Terms Of *Land* Area (Excluding Water) ? - Flytrippers (6)'; } document.getElementById("ftAdsTxt").innerHTML = '

'+imageTxt+'

'+imageButtonTxt+''; //Add class to change css if the ad text if too long if (imageTxt.length > 60){ document.getElementById("ftAdsTxt").classList.add("ftAdsTxt_long"); } //Add class if on deal page to correct css if (dealRegion !== '') { document.getElementById("mobileLogo").classList.add("mobileLogoDealPage"); document.getElementById("ftAdsTxt").classList.add("ftAdsTxtDealPage"); } } /* Click actions */ //Hide the ads if X is clicked document.getElementById("closeFtAds").addEventListener("click", function goToLinkUrl(){ document.getElementById("customFtAds").style.display = "none"; }); //If ads is clicked go to correct page document.getElementById("ftAdsContainer").addEventListener("click", function goToLinkUrl(){ if (mapArticles.includes(currentURL)){ window.location.href = goUrl + "?adhesionAds"+adVersion; } else if (webinar.includes(currentURL)){ //Click on the a element to trigger the popup document.getElementById('ftAdsTxt_a').click(); }else { window.location.href = goUrl + "?adhesionAds"; } });} else { //User not in Canada, show regular mediavine ads document.getElementById("customFtAds").style.display = "none";}})();

Top Articles
Latest Posts
Article information

Author: Otha Schamberger

Last Updated: 10/24/2022

Views: 5798

Rating: 4.4 / 5 (75 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Otha Schamberger

Birthday: 1999-08-15

Address: Suite 490 606 Hammes Ferry, Carterhaven, IL 62290

Phone: +8557035444877

Job: Forward IT Agent

Hobby: Fishing, Flying, Jewelry making, Digital arts, Sand art, Parkour, tabletop games

Introduction: My name is Otha Schamberger, I am a vast, good, healthy, cheerful, energetic, gorgeous, magnificent person who loves writing and wants to share my knowledge and understanding with you.