Company of Heroes 2: Ardennes Assault (Game) – Giant Bomb { self.triggerEvent(‘tracking_initialized’); self.trackingInitialized = true; }); } if (obj[category]) { self.loadScriptIds[id] = true; callback.apply(this, [_cbsoptanon, options]); } else { self.loadScriptIds[id] = false; // call disableCallback() if available if (disableCallback !== undefined && typeof disableCallback === “function”) { disableCallback(); } } }); }; checkState(); // consent has changed and we’re allowed to fire off _cbsoptanon.ot.addOnConsentChangedHandler(function() { if (self.loadScriptIds[id] != true) { checkState(); } }); // when category is null, don’t gated by above code, some 3rd party Ads already integrated with Optanton // for example: bidbarrel version above v2.8, GPT stuff(google tag) } else { // Just waiting for on ready fire callback self.loadScriptIds[id] = true; callback.apply(this, [_cbsoptanon, options]); } }); // Only few pages that are not asking for consent fire the load event immediately if (this.consent) { callback(); } else { document.addEventListener(‘loadThirdParty’, function (e) { callback(); }); } }, /** * Trigger the consent event so the rest of the scripts can load * This should only be called after GDPR script has run and the user has given consent */ triggerConsent: function () { this.consent = true; this.triggerEvent(‘loadThirdParty’) }, /** * Trigger an event on the document * @param {string} eventName */ triggerEvent: function (eventName) { var event = null; if (typeof(Event) === ‘function’) { var event = new Event(eventName); } // IE 11 and below doesn’t support the Event constructor, use the old deprecated way of creating events else { var event = document.createEvent(‘Event’); event.initEvent(eventName, true, true); } document.dispatchEvent(event); }, /** * Monitor a script tag for failure to load. If it fails to load mark failed * @param {Element} script Script element to monitor */ monitorKeyScript: function (script) { var self = this; script.addEventListener(‘error’, function (err) { if (err) { self.scriptFailed = true; } }); }, /** * Have key scripts failed to load * @return {boolean} Returns true if any of the key scripts we monitor have failed to load */ keyScriptsFailed: function () { return this.scriptFailed; } }; /** * When third party consent is received run all the scripts we’ve queued up */ PhoenixLoader.gdprConsentCallback(true, function () { var scripts = PhoenixLoader.scripts; Object.keys(scripts).forEach(function (key) { includeScript(key, scripts[key].url, scripts[key].async); delete scripts[key]; }); }); // Monitor optanon as a key script, if it fails to load we want to trigger all tracking ready events so site features will work even though tracking will not work. // Normally we would put this by the script include itself but we include optanon as the first thing in the head tag PhoenixLoader.monitorKeyScript(document.getElementById(‘bb-cbsoptanon’)); })(); ]]> ]]> DraftsSubmittedReviewed 0) { %>
Wiki Contributions
Contributions
No Changes Pending Review
No Changes Reviewed
- Add to or edit anything in the wiki, and your changes will show up here
- When you’re done, submit your changes for review
- If your changes are approved by our moderators, they will then appear on the page
My Wiki Contributions
Changes