/**
* Ad Management and Tracking Script
* Handles ad wrapper selection, Facebook pixel tracking, and revenue reporting
*/
class AdManager {
constructor() {
this.config = {
prebidTimeout: 1500,
cpmMarginPercent: 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;
this.init();
}
/**
* Initialize the ad manager
*/
async init() {
this.setupPreconnections();
this.setupAnalytics();
await this.waitForDocumentReady();
await this.loadScripts();
this.setupEventListeners();
this.setupFacebookPixel();
}
/**
* Setup DNS preconnections for better performance
*/
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 => {
const link = document.createElement('link');
link.rel = 'preconnect';
link.href = url;
document.head.appendChild(link);
});
}
/**
* Setup analytics custom variables
*/
setupAnalytics() {
window.assertiveQueue = window.assertiveQueue || [];
window.assertiveQueue.push(() => {
if (window.assertive?.analytics?.custom) {
window.assertive.analytics.custom.custom_6 = "AY_wrapper";
window.assertive.analytics.custom.custom_4 = `Layout_${window.ads_layout}`;
}
});
}
/**
* Wait for document to be ready
*/
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);
});
}
/**
* Load AY ad wrapper script
*/
loadAdWrapperScript() {
const script = document.createElement("script");
script.src = "https://jk3yfTwHczNirJfKt.ay.delivery/manager/jk3yfTwHczNirJfKt";
script.referrerPolicy = "no-referrer-when-downgrade";
document.head.appendChild(script);
}
/**
* Load required scripts
*/
async loadScripts() {
// 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;
}
/**
* Setup Facebook pixel noscript fallback
*/
setupFacebookNoscript() {
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);
}
/**
* Load P1 script and wait for it to be ready
*/
async loadP1Script() {
return new Promise((resolve) => {
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);
});
}
/**
* Setup Facebook pixel tracking
*/
setupFacebookPixel() {
// 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;
}
/**
* Setup event listeners for ad tracking
*/
setupEventListeners() {
// Revenue tracking
window.addEventListener("assertive_predictedRevenue", (event) => {
this.handlePredictedRevenue(event);
}, false);
// Impression logging
window.addEventListener("assertive_logImpression", (event) => {
this.handleLogImpression(event);
});
}
/**
* Handle predicted revenue events
*/
handlePredictedRevenue(event) {
const { data } = event;
let winnerCPM = data.predictedRevenueCPM.impression;
if (winnerCPM === 0) return;
this.log("assertive_predictedRevenue", window.assertive?.analytics?.custom?.custom_6, 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.slotId,
};
// Determine winner and platform
const { winner, biddingPlatformId } = this.determineWinner(data);
// Report to external systems
this.reportWin({
biddingPlatformId,
partnerAuctionId: data.meta.auctionId,
bidderCode: winner,
prebidAuctionId: data.meta.auctionId,
cpm: winnerCPM,
currency: "USD",
originalCpm: winnerCPM,
originalCurrency: "USD",
status: "rendered",
placementId: data.meta.slotId,
});
// Send Facebook pixel event
if (typeof fbq !== "undefined") {
fbq("track", "Purchase", fbPixelData);
}
// Update analytics
this.updateAnalytics();
}
/**
* Determine auction winner and platform
*/
determineWinner(data) {
let biddingPlatformId = 3; // Default to Google
let winner = "Google";
if (data.meta.dfpResponseInformation) {
const advertiserId = data.meta.dfpResponseInformation.advertiserId;
if (advertiserId === 4566943199) {
biddingPlatformId = 1; // Prebid
winner = data.meta.highestBid.bidderCode;
} else if (advertiserId === 4726541655) {
biddingPlatformId = 2; // Amazon
winner = "amazon";
}
}
return { winner, biddingPlatformId };
}
/**
* Send aggregated purchase value to pixel
*/
sendPurchaseAggregatedValue(winnerCPM) {
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();
}
/**
* Process small increment events
*/
processSmallEvents() {
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,
});
}
});
}
/**
* Process $10 incremental events
*/
processIncrementalEvents() {
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,
});
}
}
/**
* Process milestone events ($30, $50, $80, $100)
*/
processMilestoneEvents() {
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,
});
}
});
}
/**
* Send custom event to Facebook and internal tracking
*/
sendCustomEvent(eventName, data) {
if (typeof fbq !== "undefined") {
fbq("trackCustom", eventName, data);
}
if (typeof cis_send_custom_event !== "undefined") {
cis_send_custom_event(eventName, data);
}
}
/**
* Handle log impression events
*/
handleLogImpression(event) {
const payload = event.data.payload;
const mediaType = 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;
}
}
/**
* Report win to external systems
*/
reportWin(winData) {
// Report to IntentIQ (if not Chrome)
if (!this.isChrome && typeof intentIq_612283370 !== "undefined") {
intentIq_612283370.reportExternalWin(winData);
}
}
/**
* Update analytics based on IntentIQ configuration
*/
updateAnalytics() {
if (typeof intentIq_612283370 !== "undefined" && intentIq_612283370.intentIqConfig) {
const testGroup = intentIq_612283370.intentIqConfig.abTesting.currentTestGroup;
if (window.assertive?.analytics?.custom) {
window.assertive.analytics.custom.custom_8 = testGroup === "A" ? "IIQ_Enabled" : "IIQ_Disabled";
}
if (testGroup === "A") {
window.iiqCallbackMethod_init = true;
}
}
}
/**
* Utility logging method
*/
log(...args) {
if (this.config.showLogs) {
console.log(...args);
}
}
/**
* Send event to internal API
*/
sendToApi(eventName) {
if (typeof cis_send_to_api !== "undefined") {
cis_send_to_api(eventName);
}
}
}
// Initialize the ad manager
const adManager = new AdManager();
// Add Impact site verification meta tag
const metaTag = document.createElement('meta');
metaTag.name = 'impact-site-verification';
metaTag.content = 'bd46cba2-8f9e-4fd2-97e3-030369b052ff';
document.head.appendChild(metaTag);
17 of the Craziest Reasons for Denying Women’s Suffrage Throughout History
Trista - October 5, 2018
One of the surprising outcomes of the 2016 presidential election is a force that is deeply rooted in America and refuses to leave: anti-feminism. Despite the repeated complaints of sexual misconduct and other forms of misogyny by Donald Trump, many women chose to vote for him. Why? Because some of these women believe that their place was at home, and Donald Trump seemed to be the man to restore the traditional family values that America has been disregarding ever since the rise of feminism in the nineteenth and twentieth centuries.
What these women don’t realize is that their right to vote for Donald Trump in the first place was hard-won by early feminists; in fact, the overcome for suffrage was one of the first major victories of the feminist movement in the United States. Below are some of the real yet bizarre justifications that many people — both men and women — used to deprive women of the right to vote.
A suffrage poster. The Development of Women’s Rights