@guardian/libs
Advanced tools
Comparing version 0.0.0-canary-20240620131201 to 0.0.0-canary-20240620133132
import { isGuardianDomain } from './domain.js'; | ||
const ACCOUNT_ID = 1257; | ||
const PROPERTY_ID = 7417; | ||
const PROPERTY_ID_AUSTRALIA = 13348; | ||
const PRIVACY_MANAGER_CCPA = 540252; | ||
@@ -9,2 +11,2 @@ const PRIVACY_MANAGER_TCFV2 = 106842; | ||
export { ACCOUNT_ID, ENDPOINT, PRIVACY_MANAGER_AUSTRALIA, PRIVACY_MANAGER_CCPA, PRIVACY_MANAGER_TCFV2 }; | ||
export { ACCOUNT_ID, ENDPOINT, PRIVACY_MANAGER_AUSTRALIA, PRIVACY_MANAGER_CCPA, PRIVACY_MANAGER_TCFV2, PROPERTY_ID, PROPERTY_ID_AUSTRALIA }; |
@@ -5,3 +5,3 @@ import { log } from '../logger/logger.js'; | ||
import { mark } from './lib/mark.js'; | ||
import { ENDPOINT, ACCOUNT_ID } from './lib/sourcepointConfig.js'; | ||
import { ENDPOINT, ACCOUNT_ID, PROPERTY_ID_AUSTRALIA, PROPERTY_ID } from './lib/sourcepointConfig.js'; | ||
import { invokeCallbacks } from './onConsentChange.js'; | ||
@@ -14,3 +14,3 @@ import { stub } from './stub.js'; | ||
}); | ||
const getProperty = (framework) => { | ||
const getPropertyHref = (framework) => { | ||
if (framework == "aus") { | ||
@@ -21,2 +21,8 @@ return "https://au.theguardian.com"; | ||
}; | ||
const getPropertyId = (framework) => { | ||
if (framework == "aus") { | ||
return PROPERTY_ID_AUSTRALIA; | ||
} | ||
return PROPERTY_ID; | ||
}; | ||
const init = (framework, pubData = {}) => { | ||
@@ -30,2 +36,3 @@ stub(framework); | ||
const frameworkMessageType = framework == "tcfv2" ? "gdpr" : "ccpa"; | ||
const isInPropertyIdABTest = window.guardian?.config?.page?.abTests?.useSourcepointPropertyIdVariant === "variant"; | ||
log("cmp", `framework: ${framework}`); | ||
@@ -38,3 +45,3 @@ log("cmp", `frameworkMessageType: ${frameworkMessageType}`); | ||
accountId: ACCOUNT_ID, | ||
propertyHref: getProperty(framework), | ||
propertyHref: getPropertyHref(framework), | ||
targetingParams: { | ||
@@ -121,2 +128,5 @@ framework | ||
}; | ||
if (isInPropertyIdABTest) { | ||
window._sp_.config.propertyId = getPropertyId(framework); | ||
} | ||
switch (framework) { | ||
@@ -123,0 +133,0 @@ case "tcfv2": |
@@ -1,3 +0,3 @@ | ||
var version = "0.0.0-canary-20240620131201"; | ||
var version = "0.0.0-canary-20240620133132"; | ||
export { version }; |
{ | ||
"name": "@guardian/libs", | ||
"version": "0.0.0-canary-20240620131201", | ||
"version": "0.0.0-canary-20240620133132", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "A collection of JavaScript libraries and TypeScript types for Guardian projects", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
228305
7304