Intent to Implement: Real Time Config 2 #11321
Labels
INTENT TO IMPLEMENT
Proposes implementation of a significant new feature. https://bit.ly/amp-contribute-code
P1: High Priority
WG: monetization
Projects
Milestone
Real Time Config 2.0
Objective
For AMP Fast Fetch, support publisher-specified, multiple, simultaneous callouts in order to augment targeting information included on the ad request. See original RTC I2I #8551.
Background
Remote HTML support was added for delayed fetch to support first party cookie targeting given AMP does not allow custom javascript and pages served from the AMP cache are identical for each user. However, its implementation leverages the fact that custom javascript execution occurs as a part of generating an ad request. Fast fetch allows for sending the ad request early by moving all code related to ad generation within the AMP runtime and is therefore incompatible with remote HTML. Real Time Config (RTC) was added to DoubleClick to allow for per-user targeting, see the initial I2I #8551 and the initial implementation #9857 . In order to support augmenting queries with targeting data from multiple sources, we propose modifying the design to allow multiple call-outs executed per slot.
Overview
The new design of RTC is per-slot, with a maximum of 5 parallel call-outs allowed per slot. RTC will be usable by any Fast Fetch network implementation. Call-outs for all slots will be sent as soon as possible. There are two different types of callouts that will be supported (see Example section below):
1. Custom URL callout
2. Vendor-Specified URL
In both cases, the results of these call-outs will be passed to the Fast Fetch implementations as part of ad url construction.
Requirements
Design
AmpA4A Modifications
Only Fast Fetch extensions are eligible for Real Time Config, and can opt-in by importing real-time-config-manager.js and modifying getAdUrl to consume the results.
If a publisher then wishes to utilize RTC on their page, they must add a valid RTC configuration to their amp-ad elements.
Both a valid Fast Fetch network and a valid publisher configuration are checked before RTC is executed on a page:
Publishers specify callout targets at the slot level on the amp-ad tag via ‘rtc-config’ parameter. Additionally, publishers can specify a timeout value,of 1 second or less (default value is 1 second). Here is an example, with the JSON object expanded for readability:
Specification for rtc-config attribute:
In order to spare publishers the details of having to construct urls for external vendors, vendors may register a url with macros in a central file called callout-vendors.js, which maps unique vendor names to urls. The url for a vendor will be expanded, given custom values provided by the publisher, prior to callout. For instance:
Publishers may also utilize macro substitution for non-vendor urls. In this case, instead of macro keys being specified by a vendor and values being specified by the publisher, both the keys and values are specified by the ad network overriding getCustomCalloutMacros in their Fast Fetch implementation.
For instance, take this example allowing SIZE to be inflated in call-out urls:
First, the ad network overrides getCustomCalloutMacros:
Then a publisher specifies the macro in their RTC url as follows:
The RealTimeConfigManager will then merge the results of getCustomCalloutMacros into the publisher specified URL, which in this example, with an ad size of 320x50, yields https://pub.com/rtc-endpoint?size=320x50
One XHR CORS request will be made to each endpoint specified, with all requests happening in parallel. Upon completion of callouts, the RealTimeConfig manager will pass getAdUrl an array of all the response objects, formatted as:
Note that in the event of a timeout, the call-out request is not cancelled. This allows for the response to return a cache header which can be used in later slot requests.
Single Request Architecture (SRA) Support
There is no SRA support at this time. In the event that SRA and RTC are attempted to be used on the same page, RTC will take precedence, and SRA will not be used.
Example
CoolSportsPublisher.com wants to use RTC to make call-outs to VendorFooBar, as well as to their own targeting endpoint, and they only want to allow for a 500ms timeout.
VendorFooBar is registered in callout-vendors.js as seen here:
CoolSportsPublisher’s targeting server endpoint is located at https://www.CSPAnalytics.com/tgt/f.html
With these requirements, CoolSportsPublisher should set up their amp-ad as follows:
Two parallel call-outs will result from this specification, the two urls called out to will be:
https://www.CSPAnalytics.com/tgt/f.html?page_id=1a2b3c
https://vendorFooBar.com/foo?interest=sports&color=BLU
Any call out that returns a response in less than 500ms will have its response merged into the DoubleClick ad request prior to sending.
The text was updated successfully, but these errors were encountered: