You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Update prebidUserDataFromCache API to return an object that can be
directly sent to pbjs.setConfig(ortb2.user.data) by the caller. The
returned user.data object now references Optable's requested segtax
(seller defined audience/segment taxonomy) corresponding to "Optable
Private Audiences" which is segtax=5001 as per our pending PR:
InteractiveAdvertisingBureau/openrtb#81
- Document prebidUserDataFromCache in README
- Add a link to the prebid demo page from demos/index
- Delete old prebid-us-east-16 demo pages
- Silence webpack5 warnings when building lib/core/network.ts
- Complete replacing "sandbox" with "DCN" or "dcn" in demo pages
and SDK codebase, but continue to support optable.instance.sandbox
for backward compatibility
- Update broken privacy policy link in footer of demos/index pages
- Provide link to demos/index-nocookies.html as alternative
integration example
- More succinct naming and labels and clarify documentation on
Prebid.js integration in demos
@@ -425,6 +428,161 @@ Note that you can call `installGPTEventListeners()` as many times as you like on
425
428
426
429
A working example of both targeting and event witnessing is available in the demo pages.
427
430
431
+
## Integrating Prebid
432
+
433
+
The Optable Web SDK can fetch targeting data from a DCN and prepare an audience taxonomy object similar to the one described in [the prebid.js first party data documentation](https://docs.prebid.org/features/firstPartyData.html#segments-and-taxonomy). The `prebidUserDataFromCache()` function returns the object from the targeting data stored by `targeting()` API calls in `LocalStorage`.
434
+
435
+
### Seller Defined Audiences
436
+
437
+
The HTML code snippet below shows how `prebidUserDataFromCache()` can be used to retrieve targeting data from the `LocalStorage` administered by the Optable SDK, and write Seller Defined Audiences (SDA) into [prebid.js](https://prebid.org/product-suite/prebid-js/) which is also loaded into the page, using `pbjs.setConfig({ ortb2: { user: { data: [ { ... } ] } } })` as documented in [the prebid.js first party data documentation](https://docs.prebid.org/features/firstPartyData.html#segments-and-taxonomy). The `targeting()` API is also called in order to retrieve and locally store the latest matching activations from `dcn.customer.com/my-site`.
438
+
439
+
Note that [prebid.js bidder adapters](https://docs.prebid.org/dev-docs/bidders.html) can subsequently retrieve the data from the [global config](https://docs.prebid.org/features/firstPartyData.html#supplying-global-data).
440
+
441
+
An example of how to install the SDA data through `pbjs` is shown below. The `districtMDMX` bidder adapter is referenced, though the integration would look similar with any SDA compatible bidder adapters.
442
+
443
+
For a working demo showing a `pbjs` and GAM integrated together, see the [demo pages section](#demo-pages) below.
For bidder adapters that do not support SDA, but that do support targeting private marketplace deals to key values, you can use a samilar approach to the [Google Ad Manager integration with key values from local cache](#targeting-key-values-from-local-cache). For example, for the IX bidder adapter and [IX bidder-specific FPD](https://docs.prebid.org/dev-docs/bidders/ix.html#ix-bidder-specific-fpd), you can encode the targeting key values as shown below:
540
+
541
+
```html
542
+
<script>
543
+
// ...
544
+
// prior to pbjs.requestBids():
545
+
pbjs.que.push(function () {
546
+
optable.cmd.push(function () {
547
+
consttdata=optable.instance.targetingFromCache();
548
+
var fpd = {};
549
+
550
+
/*
551
+
* Flatten targeting key=values from Optable SDK targeting cache
552
+
* into a custom key value object, such that a key K with values
553
+
* V1, V2, ... in the Optable SDK targeting cache is transformed
554
+
* to look like:
555
+
* {
556
+
* K + V1: 1,
557
+
* K + V2: 1,
558
+
* ...
559
+
* }
560
+
*
561
+
* Note that + above indicates string concatenation.
562
+
*
563
+
* Optable DCNs have K configured to "optable" by default, so the
564
+
* above would result in a custom key value "optable_audienceKeyword=1"
565
+
* being set whenever the visitor is matched to the activated audience
566
+
* specified by audienceKeyword by the DCN.
567
+
*/
568
+
for (const [key, values] ofObject.entries(tdata || {})) {
569
+
for (constsegof values) {
570
+
fpd[key + seg] ="1";
571
+
}
572
+
}
573
+
574
+
pbjs.setConfig({
575
+
ix: {
576
+
firstPartyData: fpd,
577
+
},
578
+
});
579
+
});
580
+
581
+
pbjs.requestBids(...);
582
+
});
583
+
</script>
584
+
```
585
+
428
586
## Identifying visitors arriving from Email newsletters
429
587
430
588
If you send Email newsletters that contain links to your website, then you may want to automatically _identify_ visitors that have clicked on any such links via their Email address.
@@ -460,3 +618,5 @@ On your website destination page, you can call a helper method provided by the S
460
618
The demo pages are working examples of both `identify` and `targeting` APIs, as well as an integration with the [Google Ad Manager 360](https://admanager.google.com/home/) ad server, enabling the targeting of ads served by GAM360 to audiences activated in the [Optable](https://optable.co/) DCN.
461
619
462
620
You can browse a recent (but not necessarily the latest) released version of the demo pages at [https://demo.optable.co/](https://demo.optable.co/). The source code to the demos can be found [here](https://github.com/Optable/optable-web-sdk/tree/master/demos). The demo pages will connect to the [Optable](https://optable.co/) demo DCN at `sandbox.optable.co` and reference the web site slug `web-sdk-demo`. The GAM360 targeting demo loads ads from a GAM360 account operated by [Optable](https://optable.co/).
621
+
622
+
Note that the demo pages at [https://demo.optable.co/](https://demo.optable.co/) will by default rely on secure HTTP first-party cookies as described [here](https://github.com/Optable/optable-web-sdk#domains-and-cookies). To see an example based on [LocalStorage](https://github.com/Optable/optable-web-sdk#localstorage), see the [index-nocookies variant here](https://demo.optable.co/index-nocookies.html).
0 commit comments