關閉 回到頁首發表意見 //定義DFP非同步廣告版位 var ctFirstTimeToEnterSite = $.cookie("ctFirstTimeToEnterSite"), isInAppBrowser = (function () { var ua = navigator.userAgent, vendors = { "facebook": "FBAV", "line": "Line" }, key; for (key in vendors) { if (ua.indexOf(vendors[key]) > -1) { return true; } } return false; })(); if (ctFirstTimeToEnterSite === undefined) { $.cookie("ctFirstTimeToEnterSite", "false", { "path": "/", "expires": 5 / (24 * 60) }); } googletag.cmd.push(function () { if (ctFirstTimeToEnterSite === "false" || isInAppBrowser) { googletag.defineSlot("/81206261/20_Chinatimes_Mobile/CP/20C_Mobile_InCover", [ [320, 480], [1, 1] ], "div-gpt-ad-1551201747632-0").setTargeting("cid", ["260403"]).addService(googletag.pubads()); } googletag.defineSlot("/81206261/20_Chinatimes_Mobile/CP/20C_Mobile_TopBannerN", [ [300, 250], [1, 1] ], "div-gpt-ad-1590732299155-0").setTargeting("cid", ["260403"]).addService(googletag.pubads()); googletag.defineSlot("/81206261/20_Chinatimes_Mobile/CP/20C_Mobile_MiddleBannerN", [ [1, 1], [320, 480] ], "div-gpt-ad-1590732428465-0").setTargeting("cid", ["260403"]).addService(googletag.pubads()); googletag.defineSlot("/81206261/20_Chinatimes_Mobile/CP/20C_Mobile_InRead", [ [1, 1], "fluid" ], "div-gpt-ad-1551201747632-3").setTargeting("cid", ["260403"]).addService(googletag.pubads()); googletag.defineSlot("/81206261/20_Chinatimes_Mobile/CP/20C_Mobile_EndBanner_1st", [ [1, 1], [300, 250] ], "div-gpt-ad-1551201747632-4").setTargeting("cid", ["260403"]).addService(googletag.pubads()); googletag.defineSlot("/81206261/20_Chinatimes_Mobile/CP/20C_Mobile_EndBanner_2nd", [ [300, 250], [320, 100] ], "div-gpt-ad-1551201747632-5").setTargeting("cid", ["260403"]).addService(googletag.pubads()); googletag.defineSlot("/81206261/20_Chinatimes_Mobile/CP/20C_Mobile_StickyAd", [ [1, 1], [320, 50], [320, 100] ], "div-gpt-ad-1551201747632-6").setTargeting("cid", ["260403"]).addService(googletag.pubads()); googletag.defineSlot("/81206261/20_Chinatimes_Mobile/CP/20C_Mobile_EndText", [ [330, 65], "fluid" ], "div-gpt-ad-1603262317858-0").setTargeting("cid", ["260405"]).addService(googletag.pubads()); /* CRITEO CDB Handling */ var channelID = 2604; if (!(channelID == 2601 || channelID == 2602 || channelID == 2603 || channelID == 2608)) { var dfpSlots = googletag.pubads().getSlots(); CriteoRefreshDFP(dfpSlots); } googletag.pubads().setTargeting("aid", "20210324002693"); var hasKeywords = ""有原航平","大谷翔平","相見歡","打擊率","天使""; if (hasKeywords != "") { googletag.pubads().setTargeting("c_tag", ["有原航平","大谷翔平","相見歡","打擊率","天使"]); } googletag.pubads().enableAsyncRendering(); googletag.pubads().collapseEmptyDivs(true); googletag.enableServices(); }); //顯示DFP非同步廣告 googletag.cmd.push(function () { if (ctFirstTimeToEnterSite === "false" || isInAppBrowser) { googletag.display("div-gpt-ad-1551201747632-0"); } googletag.display("div-gpt-ad-1590732299155-0"); googletag.display("div-gpt-ad-1590732428465-0"); googletag.display("div-gpt-ad-1551201747632-3"); googletag.display("div-gpt-ad-1551201747632-4"); googletag.display("div-gpt-ad-1551201747632-5"); googletag.display("div-gpt-ad-1551201747632-6"); googletag.display("div-gpt-ad-1603262317858-0"); }); //自家點閱統計 $(function () { $.ajax({ type: 'GET', url: 'https://click2.chinatimes.com/api/Click?MQUrl=' + 'http://www.chinatimes.com/realtimenews/20210324002693-260403', contentType: "application/json; charset=UTF-8", crossDomain: true, cache: false, dataType: "jsonp" }); });