myTest

let macros = { page_url: "encodeURIComponent(`${document.location.origin}${document.location.pathname}`)", width: "window.innerWidth", height: "window.innerHeight", cb: "Math.random()", sr_format: "js", param1: "self.interaction.interactionId", param2: "(self.interaction.publisher || {}).publisherId" }; const mon = { trackingEnabled: true, appName: "", bundleId: "", appStoreUrl: "" }; const macrosWithIos = (macros, mon) => { const {trackingEnabled, appName, advertisingId, bundleId, appStoreUrl} = mon; return { ...macros, { dnt: !trackingEnabled, ifa: advertisingId, app_name: appName, bundle_id: bundleId, app_store_url: appStoreUrl} } }; const newMacros = macrosWithIos(macros, mon); console.log(newMacros);

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.