(function() {
'use strict';
// Prevent multiple initializations
if (window.adManagerInitialized) {
return;
}
window.adManagerInitialized = true;
class AdManager {
constructor() {
this.config = {
prebidTimeout: 1500,
cpmMarginPercent: parseInt(window.cpmMarginPercent) || 0,
showLogs: window.cis_show_logs || false
};
this.pixel = {
adsAmountValue: 0,
lastSentValue: 0,
eventFired: 0,
smallEventFired: 0,
smallEvents: [1, 2, 2.5, 3, 4, 5, 6, 7, 7.5, 8, 9]
};
this.doneAuctionsWins = window.doneAuctionsWins || [];
this.isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
this.isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
// Initialize immediately
this.init().catch(error => {
this.log('AdManager initialization error:', error);
});
}
async init() {
try {
this.setupPreconnections();
this.setupAnalytics();
await this.waitForDocumentReady();
await this.loadScripts();
this.setupEventListeners();
this.setupFacebookPixel();
this.log('AdManager initialized successfully');
} catch (error) {
this.log('Error during initialization:', error);
}
}
setupPreconnections() {
const preconnectUrls = [
'https://fonts.gstatic.com',
'https://adservice.google.com',
'https://tpc.googlesyndication.com',
'https://securepubads.g.doubleclick.net',
'https://pagead2.googlesyndication.com',
'https://pubads.g.doubleclick.net',
'https://www.google-analytics.com',
'https://www.googletagservices.com',
'https://c.amazon-adsystem.com',
'https://aax.amazon-adsystem.com',
'https://connect.facebook.net'
];
preconnectUrls.forEach(url => {
try {
const link = document.createElement('link');
link.rel = 'preconnect';
link.href = url;
document.head.appendChild(link);
} catch (error) {
this.log('Error adding preconnect for', url, error);
}
});
}
setupAnalytics() {
try {
window.assertiveQueue = window.assertiveQueue || [];
window.assertiveQueue.push(() => {
if (window.assertive && window.assertive.analytics && window.assertive.analytics.custom) {
window.assertive.analytics.custom.custom_6 = "AY_wrapper";
window.assertive.analytics.custom.custom_4 = 'Layout_' + (window.ads_layout || 'unknown');
}
});
} catch (error) {
this.log('Error setting up analytics:', error);
}
}
async waitForDocumentReady() {
return new Promise((resolve) => {
if (document.readyState === "interactive" || document.readyState === "complete") {
resolve();
return;
}
const checkInterval = setInterval(() => {
if (document.readyState === "interactive" || document.readyState === "complete") {
clearInterval(checkInterval);
resolve();
}
}, 20);
});
}
loadAdWrapperScript() {
try {
const script = document.createElement("script");
script.src = "https://jk3yfTwHczNirJfKt.ay.delivery/manager/jk3yfTwHczNirJfKt";
script.referrerPolicy = "no-referrer-when-downgrade";
document.head.appendChild(script);
} catch (error) {
this.log('Error loading ad wrapper script:', error);
}
}
async loadScripts() {
try {
// Load ad wrapper
this.loadAdWrapperScript();
// Load Facebook pixel noscript
this.setupFacebookNoscript();
// Load P1 script
await this.loadP1Script();
// Set prebid timeout
window.PREBID_TIMEOUT = this.config.prebidTimeout;
} catch (error) {
this.log('Error loading scripts:', error);
}
}
setupFacebookNoscript() {
try {
const noscript = document.createElement("noscript");
const img = document.createElement("img");
img.height = "1";
img.width = "1";
img.style.display = "none";
img.src = "https://www.facebook.com/tr?id=1581007252192655&ev=PageView&noscript=1";
noscript.appendChild(img);
document.head.appendChild(noscript);
} catch (error) {
this.log('Error setting up Facebook noscript:', error);
}
}
async loadP1Script() {
return new Promise((resolve) => {
try {
const script = document.createElement("script");
script.id = "script_p1";
script.src = "https://cdn.historycollection.com/wp-content/uploads/2024/03/p1.js";
script.onload = () => resolve();
script.onerror = () => resolve(); // Continue even if script fails
document.head.appendChild(script);
// Fallback timeout
setTimeout(resolve, 5000);
} catch (error) {
this.log('Error loading P1 script:', error);
resolve();
}
});
}
setupFacebookPixel() {
try {
// Initialize pixel globals
window.pixel_ads_amount_value = this.pixel.adsAmountValue;
window.pixel_last_sent_value = this.pixel.lastSentValue;
window.pixel_event_fired = this.pixel.eventFired;
window.pixel_small_event_fired = this.pixel.smallEventFired;
window.pixel_small_events = this.pixel.smallEvents;
} catch (error) {
this.log('Error setting up Facebook pixel:', error);
}
}
setupEventListeners() {
try {
// Revenue tracking
window.addEventListener("assertive_predictedRevenue", (event) => {
this.handlePredictedRevenue(event);
}, false);
// Impression logging
window.addEventListener("assertive_logImpression", (event) => {
this.handleLogImpression(event);
});
} catch (error) {
this.log('Error setting up event listeners:', error);
}
}
handlePredictedRevenue(event) {
try {
const data = event.data;
if (!data || !data.predictedRevenueCPM) {
return;
}
let winnerCPM = data.predictedRevenueCPM.impression;
if (winnerCPM === 0) return;
this.log("assertive_predictedRevenue", window.assertive && window.assertive.analytics && window.assertive.analytics.custom ? window.assertive.analytics.custom.custom_6 : 'unknown', winnerCPM);
// Update aggregated value and send pixel events
this.sendPurchaseAggregatedValue(winnerCPM);
// Apply margin if configured
if (this.config.cpmMarginPercent > 0) {
winnerCPM = winnerCPM - (winnerCPM * this.config.cpmMarginPercent) / 100;
}
if (winnerCPM < 0) return;
// Prepare Facebook pixel data
const fbPixelData = {
value: winnerCPM,
currency: "USD",
content_ids: window.location.href.split("/")[3] || '',
content_type: "Product",
bidder: "Google",
adUnit: data.meta ? data.meta.slotId : '',
};
// Determine winner and platform
const winnerInfo = this.determineWinner(data);
// Report to external systems
this.reportWin({
biddingPlatformId: winnerInfo.biddingPlatformId,
partnerAuctionId: data.meta ? data.meta.auctionId : '',
bidderCode: winnerInfo.winner,
prebidAuctionId: data.meta ? data.meta.auctionId : '',
cpm: winnerCPM,
currency: "USD",
originalCpm: winnerCPM,
originalCurrency: "USD",
status: "rendered",
placementId: data.meta ? data.meta.slotId : '',
});
// Send Facebook pixel event
if (typeof fbq !== "undefined") {
fbq("track", "Purchase", fbPixelData);
}
// Update analytics
this.updateAnalytics();
} catch (error) {
this.log('Error handling predicted revenue:', error);
}
}
determineWinner(data) {
let biddingPlatformId = 3; // Default to Google
let winner = "Google";
try {
if (data.meta && data.meta.dfpResponseInformation) {
const advertiserId = data.meta.dfpResponseInformation.advertiserId;
if (advertiserId === 4566943199) {
biddingPlatformId = 1; // Prebid
winner = data.meta.highestBid ? data.meta.highestBid.bidderCode : winner;
} else if (advertiserId === 4726541655) {
biddingPlatformId = 2; // Amazon
winner = "amazon";
}
}
} catch (error) {
this.log('Error determining winner:', error);
}
return { winner: winner, biddingPlatformId: biddingPlatformId };
}
sendPurchaseAggregatedValue(winnerCPM) {
try {
this.pixel.adsAmountValue += winnerCPM;
window.pixel_ads_amount_value = this.pixel.adsAmountValue;
if (typeof fbq === "undefined") return;
// Process small events
this.processSmallEvents();
// Process $10 increments
this.processIncrementalEvents();
// Process milestone events
this.processMilestoneEvents();
} catch (error) {
this.log('Error sending purchase aggregated value:', error);
}
}
processSmallEvents() {
try {
this.pixel.smallEvents.forEach((threshold, index) => {
if (this.pixel.smallEventFired <= index && this.pixel.adsAmountValue > threshold) {
this.pixel.smallEventFired++;
window.pixel_small_event_fired = this.pixel.smallEventFired;
const eventName = (threshold / 10) + "R" + (window.site_prefix || '');
this.sendCustomEvent(eventName, {
currency: "USD",
value: threshold,
});
}
});
} catch (error) {
this.log('Error processing small events:', error);
}
}
processIncrementalEvents() {
try {
while (
this.pixel.adsAmountValue > 10 &&
this.pixel.adsAmountValue < 310 &&
this.pixel.adsAmountValue > this.pixel.lastSentValue + 10
) {
this.pixel.lastSentValue += 10;
window.pixel_last_sent_value = this.pixel.lastSentValue;
const eventName = (this.pixel.lastSentValue / 10) + "R" + (window.site_prefix || '');
this.sendCustomEvent(eventName, {
currency: "USD",
value: this.pixel.lastSentValue,
});
}
} catch (error) {
this.log('Error processing incremental events:', error);
}
}
processMilestoneEvents() {
try {
const milestones = [
{ threshold: 30, event: "HC_30" },
{ threshold: 50, event: "HC_50" },
{ threshold: 80, event: "HC_80" },
{ threshold: 100, event: "HC_100" }
];
milestones.forEach((milestone, index) => {
if (this.pixel.adsAmountValue > milestone.threshold && this.pixel.eventFired === index) {
this.pixel.eventFired++;
window.pixel_event_fired = this.pixel.eventFired;
this.sendCustomEvent(milestone.event, {
currency: "USD",
value: this.pixel.adsAmountValue,
});
}
});
} catch (error) {
this.log('Error processing milestone events:', error);
}
}
sendCustomEvent(eventName, data) {
try {
if (typeof fbq !== "undefined") {
fbq("trackCustom", eventName, data);
}
if (typeof cis_send_custom_event !== "undefined") {
cis_send_custom_event(eventName, data);
}
} catch (error) {
this.log('Error sending custom event:', error);
}
}
handleLogImpression(event) {
try {
const payload = event.data ? event.data.payload : null;
if (!payload) return;
const mediaType = (payload.highestBid && payload.highestBid.mediaType) || "banner";
if (payload.unfilled || payload.sourceInternal !== "gpt") {
return;
}
// Apply iOS bias for banner ads
if (mediaType === "banner" && this.isIOS) {
payload.revenueBias = 0.975;
}
} catch (error) {
this.log('Error handling log impression:', error);
}
}
reportWin(winData) {
try {
// Report to IntentIQ (if not Chrome)
if (!this.isChrome && typeof intentIq_612283370 !== "undefined" && intentIq_612283370.reportExternalWin) {
intentIq_612283370.reportExternalWin(winData);
}
} catch (error) {
this.log('Error reporting win:', error);
}
}
updateAnalytics() {
try {
if (typeof intentIq_612283370 !== "undefined" && intentIq_612283370.intentIqConfig) {
const testGroup = intentIq_612283370.intentIqConfig.abTesting ? intentIq_612283370.intentIqConfig.abTesting.currentTestGroup : null;
if (window.assertive && window.assertive.analytics && window.assertive.analytics.custom) {
window.assertive.analytics.custom.custom_8 = testGroup === "A" ? "IIQ_Enabled" : "IIQ_Disabled";
}
if (testGroup === "A") {
window.iiqCallbackMethod_init = true;
}
}
} catch (error) {
this.log('Error updating analytics:', error);
}
}
log() {
if (this.config.showLogs && typeof console !== 'undefined' && console.log) {
try {
console.log.apply(console, arguments);
} catch (e) {
// Silent fail if console is not available
}
}
}
}
// Initialize the ad manager
try {
window.adManager = new AdManager();
} catch (error) {
if (typeof console !== 'undefined' && console.error) {
console.error('Failed to initialize AdManager:', error);
}
}
// Add Impact site verification meta tag
try {
const metaTag = document.createElement('meta');
metaTag.name = 'impact-site-verification';
metaTag.content = 'bd46cba2-8f9e-4fd2-97e3-030369b052ff';
document.head.appendChild(metaTag);
} catch (error) {
if (typeof console !== 'undefined' && console.error) {
console.error('Failed to add meta tag:', error);
}
}
})();
Killing the Duke: Did Stalin Really Order The Assassination of John Wayne?
Patrick Lynch - January 17, 2018
The infamous dictator, Joseph Stalin, was notoriously paranoid and saw enemies everywhere but did he really ask his minions to murder John Wayne because of the movie star’s political views? It seems far-fetched, but according to a book entitled John Wayne – The Man Behind the Myth by Michael Munn, Stalin believed that Wayne’s vocal anti-communist views were a threat to the Soviet Union.
Let’s be clear, Munn’s primary source for this tale came from none other than legendary actor Orson Welles who spoke to Munn at a dinner in 1983. According to Welles, the KGB had been ordered to kill John Wayne. While Munn acknowledged that Welles was a brilliant storyteller, the film historian noted that Welles was not exactly a fan of Wayne. Moreover, he offered the story without prompting. First and foremost, how did Stalin learn about John Wayne and his anti-communist rhetoric?
Aging Stalin – Biography.com
Stalin Was a Movie Obsessive
According to Politburo archives opened in the early 21st century, Stalin loved movies and apparently told Sergei Eisenstein (director of Battleship Potemkin among others) how to make movies. Every single one of Stalin’s houses had a private cinema, and in his later years, the cinema served as his main source of political inspiration and his favored form of entertainment. In fact, Stalin saw himself as a writer, producer, and director extraordinaire.
The dictator apparently enjoyed watching Western movies and associated himself with the gun-toting lone cowboy who rode into town to mete out brutal justice. As a result, he was a fan of the work of John Ford and John Wayne. According to his successor, Nikita Khrushchev, Stalin would ideologically criticize the cowboy films he watched, and then order more. Although he loved these movies, one source suggested Stalin said that John Wayne was a threat to the Communist cause and must be executed.
Young John Wayne – Ranker.com
John Wayne Hated Communism
Even today, Communism is abhorred in the United States and John Wayne held the typical American position of supporting anti-communist positions. Born Marion Mitchell Morrison, the ‘Duke’ was actually pro-socialist in his college days, and he voted for Franklin D. Roosevelt in the 1936 Presidential Election. He also admired Harry Truman, the Democrat who was president from 1945 – 1953.
However, Wayne swiftly moved away from the left and created the Motion Picture Alliance for the Preservation of American Ideals in 1944 and was elected president of the organization in 1949. The goal of the group was to defend the American film industry, and the nation as a whole, from the threat of communist and fascist infiltration. By the end of the 1940s, Wayne was known for his ardent anti-communist stance. In 1952, he made the movie Big Jim McLain where he played the role of a HUAC investigator in a clear nod towards his anti-communist stance.
Stalin was aware of John Wayne’s popularity and reach. According to the story, he watched one of the star’s movies and at the end, told his men that Wayne must be assassinated. It is unclear whether the order if it was ever given, was made by a drunken Stalin in the early hours of the morning. Regardless of where and when it was given, Stalin’s men knew that failing to follow any of their leader’s orders was a quick route to a shallow grave. And so, the plot to kill John Wayne had begun; but the on-screen gunslinger survived. Let’s take a look at some of these alleged plots.