From eaa84e850a04bf09886e2fbb33019e413dddee14 Mon Sep 17 00:00:00 2001 From: MO Thibault <103271673+MO-Thibault@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:21:39 -0500 Subject: [PATCH] Remove lmpid and allow passing other ids to secure signals (#136) --- Makefile | 2 - demos/Dockerfile | 2 - demos/integration/lmpid-prebid-gpt.html.tpl | 346 -------------------- demos/integration/lmpid-signal-gpt.html.tpl | 266 --------------- lib/addons/gpt.test.js | 63 ++++ lib/addons/gpt.ts | 25 +- lib/core/storage.test.js | 12 - lib/core/storage.ts | 30 +- lib/edge/targeting.ts | 18 +- lib/sdk.ts | 5 - 10 files changed, 75 insertions(+), 694 deletions(-) delete mode 100644 demos/integration/lmpid-prebid-gpt.html.tpl delete mode 100644 demos/integration/lmpid-signal-gpt.html.tpl create mode 100644 lib/addons/gpt.test.js diff --git a/Makefile b/Makefile index aef1b5e1..adf5b083 100644 --- a/Makefile +++ b/Makefile @@ -60,8 +60,6 @@ demo-html: envsubst $(DEMO_VARS) < demos/vanilla/nocookies/targeting/gam360.html.tpl > demos/vanilla/nocookies/targeting/gam360.html envsubst $(DEMO_VARS) < demos/vanilla/nocookies/targeting/gam360-cached.html.tpl > demos/vanilla/nocookies/targeting/gam360-cached.html envsubst $(DEMO_VARS) < demos/vanilla/nocookies/targeting/prebid.html.tpl > demos/vanilla/nocookies/targeting/prebid.html - envsubst $(DEMO_VARS) < demos/integration/lmpid-prebid-gpt.html.tpl > demos/integration/lmpid-prebid-gpt.html - envsubst $(DEMO_VARS) < demos/integration/lmpid-signal-gpt.html.tpl > demos/integration/lmpid-signal-gpt.html envsubst $(DEMO_VARS) < demos/ads/protected-audience/advertiser.html.tpl > demos/ads/protected-audience/advertiser.html envsubst $(DEMO_VARS) < demos/ads/protected-audience/publisher.html.tpl > demos/ads/protected-audience/publisher.html envsubst $(DEMO_VARS) < demos/ads/protected-audience/publisher-gam.html.tpl > demos/ads/protected-audience/publisher-gam.html diff --git a/demos/Dockerfile b/demos/Dockerfile index 316f631b..f5bdd38d 100644 --- a/demos/Dockerfile +++ b/demos/Dockerfile @@ -5,8 +5,6 @@ COPY --chmod=0444 ./vanilla/targeting/gam360.html ./vanilla/targeting/gam360.htm COPY --chmod=0444 ./vanilla/targeting/gam360-cached.html ./vanilla/targeting/gam360-cached.html COPY --chmod=0444 ./vanilla/targeting/prebid.html ./vanilla/targeting/prebid.html COPY --chmod=0444 ./vanilla/targeting/prebid.js ./vanilla/targeting/prebid.js -COPY --chmod=0444 ./integration/lmpid-prebid-gpt.html ./integration/lmpid-prebid-gpt.html -COPY --chmod=0444 ./integration/lmpid-signal-gpt.html ./integration/lmpid-signal-gpt.html COPY --chmod=0444 ./integration/prebid.js ./integration/prebid.js COPY --chmod=0444 ./vanilla/identify.html ./vanilla/identify.html COPY --chmod=0444 ./vanilla/profile.html ./vanilla/profile.html diff --git a/demos/integration/lmpid-prebid-gpt.html.tpl b/demos/integration/lmpid-prebid-gpt.html.tpl deleted file mode 100644 index 26deaea3..00000000 --- a/demos/integration/lmpid-prebid-gpt.html.tpl +++ /dev/null @@ -1,346 +0,0 @@ - - -
- -- The - Optable SDK - enables easy deployment of the - Loblaw Media - Private ID (LM PID). - The LM PID is generated automatically for all identified users successfully matched with - Loblaw Media. LM PID is a secure token that contains information on matched users - that is computed within the Optable data clean room environment. It enables the - Loblaw Media DSP (MediaAisle) - to target, control ad exposure frequency, and measure the - effectiveness of Loblaw Media advertisements to identified, authenticated, and consented publisher users. -
-- This demo page shows an integration of LM PID deployed via Optable, with both Prebid.js - (including Loblaw Media's bidder adapter and user ID modules), and with - Google Publisher Tag (GPT) - and - Google Ad Manager (GAM) - Secure Signals. - Whenever possible, - it is recommended that both methods are enabled together as shown in this demo page, such that - the likelihood of MediaAisle bidding is maximised. -
- -- Contact your Optable account manager to request access to the Loblaw Media Private ID - framework integration. Once configured and enabled, the Loblaw Media partner - will appear connected in the partnerships section of the Optable user interface. -
-- Please note that Steps 2-4 below should be repeated for each web site that you would like to enable - LM PID on. -
- -- If your web site is not already represented by a source in your Optable - Data Collaboration Node (DCN), create a - Javascript SDK source - and note its - unique slug identifier, as well as the hostname of your DCN, as these will be required - for Optable SDK integration (see Step 3). -
-- LM PID will be returned by your Optable DCN for all matched users associated with - activation clean rooms originating from the Loblaw Media partner. -
- -- If you haven't already deployed the Optable SDK to your web site, have a look at the - Optable SDK README. There are two SDK APIs which you must deploy in order to integrate LM PID: - identify - and - targeting. -
-
- The identify
API enables you to associate a user's browser with a known identifier, such
- as an email address or a publisher assigned user ID. Since Loblaw Media activation matches operate on a
- combination of email address, phone number, and mobile advertising IDs, it is recommended that you
- identify
consenting users with all of that user's known and consented ad IDs.
- You can do this by calling
- identify
with additional identifiers directly from your web site, or by calling
- it with a single publisher assigned user ID, and then separately loading identity mappings
- (associated with the publisher assigned user ID) via any
- supported sources.
-
- The targeting
API retrieves targeting data, including the LM PID when available,
- and stores it in browser local storage for subsequent retrieval.
-
- For Prebid.js installations, you must make sure to include the mabidder
bidder adapter and
- the lmpid
user ID module. Note that you must include mabidder
in the
- addAdUnits()
call.
- See
- Prebid.js download instructions
- and
- Prebid.js user ID modules
- for details.
-
- For Google Publisher Tag (GPT), you must call the installGPTSecureSignals()
API
- shortly after Optable SDK instantiation. This API will configure GPT to pass lmpid
- to Google Ad Manager (GAM), when it is available in browser local storage.
-
- Try to call the Optable SDK targeting()
API as early as possible. This API will
- retrieve the latest lmpid
, when it is enabled and available for the current user,
- and store it in browser local storage for retrieval by both Prebid.js and GPT as previously described.
-
- While the lmpid
user ID module passes the Loblaw Media Private ID to the
- Loblaw Media bidder (mabidder), the installGPTSecureSignals()
API in Optable's
- Javascript SDK exposes it to Google Ad Manager via
- Secure Signals.
- Please make sure to follow Google's instructions for enabling Secure Signals sharing on your websites.
-
- The code snippet below shows an example integration with both Prebid.js and GPT on page. Note
- that {OPTABLE_DCN_HOST}
and {OPTABLE_DCN_SOURCE_SLUG}
must be replaced
- with your Optable Data Collaboration Node (DCN) hostname and Javascript SDK source slug, respectively.
-
-
// Setup Optable, Prebid.js and GPT SDKs.
-window.optable = window.optable || { cmd: [] };
-window.googletag = window.googletag || { cmd: [] };
-window.pbjs = window.pbjs || { que: [] };
-
-// When optable SDK is loaded, initialize it and install GPT Secure Signals provider.
-optable.cmd.push(function () {
- optable.instance = new optable.SDK({
- host: "{OPTABLE_DCN_HOST}",
- site: "{OPTABLE_DCN_SOURCE_SLUG}",
- });
-
- optable.instance.installGPTSecureSignals();
- optable.instance.targeting();
-});
-
-// Disable initial GPT load, required for Prebid.js
-googletag.cmd.push(function () {
- googletag.pubads().disableInitialLoad();
-});
-
-// When prebid SDK is loaded, configure it to use LMPID user ID module and
-// request bids for the defined ad units.
-
-pbjs.que.push(function () {
- // Enable Loblaw Media Private ID user ID module (lmpid):
- pbjs.mergeConfig({ userSync: { userIds: [{ name: "lmpid" }] } })
-
- // Configure some ad units.
- // Note that while it's not relevant for LMPID integration,
- // Loblaw Media's prebid ad server currently requires passing a ppid.
- pbjs.addAdUnits([{
- code: "/my/slot", // must match the defined ad slots below
- mediaTypes: { banner: { sizes: [[728, 90]] } },
- bids: [{ bidder: "mabidder", params: { ppid: "{MY_PPID}" }}],
- }]);
-
- // Define some slots
- googletag.cmd.push(function() {
- googletag
- .defineSlot("/my/slot", [[728, 90]], "ad")
- .addService(googletag.pubads());
-
- googletag.pubads().enableSingleRequest();
- googletag.enableServices();
-
- googletag.display("ad");
-
- // Request bids through Prebid.js.
- pbjs.requestBids({
- bidsBackHandler: function() {
- // Set targeting in matching GPT ad slots
- pbjs.setTargetingForGPTAsync();
-
- // Request ads
- googletag.pubads().refresh();
- },
- });
- });
-});
-
-
-
- - This demo page is setup so that the following random emails are generating LM PID requests. -
-- To trigger LM PID insertion in ad requests, you must first - identify using one of the following test email identifiers: - -
john.doe@acme.test
-emily.smith@acme.test
-alexander.wilson@acme.test
-sarah.johnson@acme.test
-david.thompson@acme.test
-lisa.brown@acme.test
-jason.miller@acme.test
-jessica.wright@acme.test
-matthew.harris@acme.test
-olivia.anderson@acme.test
-
- - The - Optable SDK - enables easy deployment of the - Loblaw Media - Private ID (LM PID). - The LM PID is generated automatically for all identified users successfully matched with - Loblaw Media. LM PID is a secure token that contains information on matched users - that is computed within the Optable data clean room environment. It enables the - Loblaw Media DSP (MediaAisle) - to target, control ad exposure frequency, and measure the - effectiveness of Loblaw Media advertisements to identified, authenticated, and consented publisher users. -
-- This demo page shows an integration of LM PID deployed via Optable, with the - Google Publisher Tag (GPT) - and - Google Ad Manager (GAM) - Secure Signals. -
- -- Contact your Optable account manager to request access to the Loblaw Media Private ID - framework integration. Once configured and enabled, the Loblaw Media partner - will appear connected in the partnerships section of the Optable user interface. -
-- Please note that Steps 2-4 below should be repeated for each web site that you would like to enable - LM PID on. -
- -- If your web site is not already represented by a source in your Optable - Data Collaboration Node (DCN), create a - Javascript SDK source - and note its - unique slug identifier, as well as the hostname of your DCN, as these will be required - for Optable SDK integration (see Step 3). -
-- LM PID will be returned by your Optable DCN for all matched users associated with - activation clean rooms originating from the Loblaw Media partner. -
- -- If you haven't already deployed the Optable SDK to your web site, have a look at the - Optable SDK README. There are two SDK APIs which you must deploy in order to integrate LM PID: - identify - and - targeting. -
-
- The identify
API enables you to associate a user's browser with a known identifier, such
- as an email address or a publisher assigned user ID. Since Loblaw Media activation matches operate on a
- combination of email address, phone number, and mobile advertising IDs, it is recommended that you
- identify
consenting users with all of that user's known and consented ad IDs.
- You can do this by calling
- identify
with additional identifiers directly from your web site, or by calling
- it with a single publisher assigned user ID, and then separately loading identity mappings
- (associated with the publisher assigned user ID) via any
- supported sources.
-
- The targeting
API retrieves targeting data, including the LM PID when available,
- and stores it in browser local storage for subsequent retrieval.
-
- You must call the installGPTSecureSignals()
SDK API
- shortly after Optable SDK instantiation. This API will configure GPT to pass lmpid
- to Google Ad Manager (GAM), when it is available in browser local storage.
-
- Try to call the Optable SDK targeting()
API as early as possible. This API will
- retrieve the latest lmpid
, when it is enabled and available for the current user,
- and store it in browser local storage for retrieval by GPT as previously described.
-
- The code snippet below shows an example integration with GPT on page. Note
- that {OPTABLE_DCN_HOST}
and {OPTABLE_DCN_SOURCE_SLUG}
must be replaced
- with your Optable Data Collaboration Node (DCN) hostname and Javascript SDK source slug, respectively.
-
-
// Setup both Optable and GPT SDKs.
-window.optable = window.optable || { cmd: [] };
-window.googletag = window.googletag || { cmd: [] };
-
-// When optable SDK is loaded, initialize it and install GPT Secure Signals provider.
-optable.cmd.push(function () {
- optable.instance = new optable.SDK({
- host: "{OPTABLE_DCN_HOST}",
- site: "{OPTABLE_DCN_SOURCE_SLUG}",
- });
-
- optable.instance.installGPTSecureSignals();
- optable.instance.targeting()
-});
-
-// When GPT SDK is loaded, define and prepare an ad slot.
-// Note that we disableInitialLoad() in order to defer the first ad request
-// until secure signals are installed.
-googletag.cmd.push(function() {
- googletag.pubads().disableInitialLoad();
-
- googletag
- .defineSlot('/my/slot', [[728, 90]], "ad")
- .addService(googletag.pubads());
-
- googletag.pubads().enableSingleRequest();
- googletag.enableServices();
- googletag.display("ad");
-});
-
-// Explicitly refresh ads when everything is loaded and the above setup is done.
-googletag.cmd.push(function () {
- optable.cmd.push(function () {
- googletag.pubads().refresh();
- });
-});
-
-
- - This demo page is setup so that the following random emails are generating LM PID requests. -
-- To trigger LM PID insertion in ad requests, you must first - identify using one of the following test email identifiers: - -
john.doe@acme.test
-emily.smith@acme.test
-alexander.wilson@acme.test
-sarah.johnson@acme.test
-david.thompson@acme.test
-lisa.brown@acme.test
-jason.miller@acme.test
-jessica.wright@acme.test
-matthew.harris@acme.test
-olivia.anderson@acme.test
-
-