AMP Integration Guide

 

Note: We are in the process of working with Google to update the AMP integration in preparation for Google's intent to deprecate delayed fetch for DoubleClick on March 28, 2018

Please refer to the following article for transition details.

  

Salesforce DMP Analytics Support for AMP

Salesforce DMP is collaborating with Google to support the Accelerated Mobile Pages Project (AMP), which is intended to optimize web page loads on mobile devices.

The AMP approach seeks to optimize asset load performance on pages. To achieve this, it restricts the publisher's ability to run their JavaScript, or those of their data partners such as Salesforce DMP. This necessitates changes to data collection methods for audience analytics, as well as segment-based ad targeting. Please note that in some cases, the restrictions imposed by AMP may impact some value-added Salesforce DMP capabilities that are available on non-AMP pages.

This article describes how Salesforce DMP supports AMP for the purposes of analytics and segment-based ad display. Note that as the specification continues to evolve, Salesforce DMP is working with Google's AMP Project team to represent our publisher clients' interests in monetizing their data in an open, privacy-safe ecosystem.

Implementing AMP Analytics

The AMP project provides the amp-analytics extension component to track and measure activity on AMP HTML documents. Publishers can enable this by adding the amp-analytics tag to their pages. Please refer to the amp-analytics documentation provided by the AMP project for description of the component.

Please note that in standard (i.e. non-AMP) web environments, Salesforce DMP collects a complete set of client specific page and behavioral data through the implementation of native JavaScript in Salesforce DMP Control Tag, and the use of Salesforce DMP Data Transfer Code (DTC). To match an equivalent data set for AMP enabled pages, publishers are required to construct and maintain the amp-analytics component to match their specific DTC requirements. This can be achieved through the combination of the vars attribute to specify page specific key-value pairs, and augmented by the extraUrlParams attribute of the amp-analytics tag.

The following are the implementation details required for integrating AMP pages with Salesforce DMP:

  • Ensure you have enabled the amp-analytics extension by placing the following code immediately before the </head> tag:
    <script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
  • Add an amp-analytics tag to activate the Salesforce DMP Analytics extension (the text SAMPLE below would be your Salesforce DMP Config ID):
    <amp-analytics type="krux" config="https://cdn.krxd.net/controltag/amp/SAMPLE.json">
    <script type="application/json">
    {
      "extraUrlParams": {
        "user.status": "developer",
        "page.keywords": "amp, mobile, examples"
      }
    }
    </script>
    </amp-analytics>
  • Publisher specific variables and user data must be provided using the extraUrlParams attribute. Variables prefixed with 'user.' are user attributes and those prefixed with 'page.' are page attributes. Any variable not prefixed with either 'user.' or 'page.' will not be properly collected.

Please contact the Salesforce DMP Solutions team at [email protected], to verify which specific attributes are required to ensure that data collection from AMP pages concur with the collection from your standard web-page deployments.

Implementing AMP Ads

AMP ads need to be served via the amp-ad tag to enable Salesforce DMP targeting via Fast Fetch. Since amp-ad tags were previously required for Salesforce DMP targeting to be enabled via Delayed Fetch, we will not provide details on the initial setup for amp-ad tags. The following instructions assume that amp-ad tags are already present on the publisher's AMP webpages:

First, contact the Salesforce DMP Solutions team at [email protected] to get the Organization ID for your Salesforce DMP instance. This Organization ID will be used to ensure we are fetching segments for your organization. When contacting Salesforce DMP Solutions, please be sure to ask for the Organization ID used for AMP tags, as we have multiple forms of the Organization ID. Please confirm that the Organization ID provided consists of 30 alphanumeric characters separated by four dashes, and looks similar to the following:

abcd1234-ef56-ab78-cd90-efghij123456

Then, locate all instances of amp-ad tags on your AMP webpages. They should look similar to the following, and have required heightwidth, and type parameters (your specific implementation may have more):

<amp-ad width=300
height=250
type="foo">
...
</amp-ad>

For each amp-ad tag, we will be adding a new attribute called rtc-config and a URL that will fetch the DFP targeting object from Salesforce DMP. If the rtc-config attribute is already present on your amp-ad tags, please do not add the attribute a second time. Instead, you should add our URL to your existing list of URLs. Please keep in mind that AMP allows a maximum of 3 URLs to be configured per amp-ad tag. Two examples are provided below.

Example 1: Adding the rtc-config attribute and the salesforce DMP URL

If your setup looks like the following, and does not already have the rtc-config attribute:

<amp-ad width=300
height=250
type="foo">
...
</amp-ad>

Add the rtc-config attribute with our URL as shown in the code snippet below. Please replace ORGANIZATION_ID with the Salesforce DMP provided Organization ID, replace REPLACE_SEGS with the DFP targeting key you want to use for Salesforce DMP segments, and replace REPLACE_ID with the DFP targeting key you want to use for the Salesforce DMP global user identifier.

<amp-ad width=300
height=250
type="foo"
rtc-config='{
"urls": [
"https://cdn.krxd.net/userdata/v2/amp/ORGANIZATION_ID?segments_key=REPLACE_SEGS&kuid_key=REPLACE_ID"
]
}'
>
...
</amp-ad>

The following is one possible way of configuring this (using a fake Organization ID):

<amp-ad width=300
height=250
type="foo"
rtc-config='{
"urls": [
"https://cdn.krxd.net/userdata/v2/amp/abcd1234-ef56-ab78-cd90-efghij123456?segments_key=kxsg&kuid_key=kuid"
]
}'>
...
</amp-ad>

Example 2: ADDING the salesforce DMP URL to your existing list of urls

If your setup looks like the following, and you already have rtc-config attribute:

<amp-ad width=300
height=250
type="foo"
rtc-config='{
"urls": [
"https://www.AmpPublisher.biz/A",
"https://www.amptgt.biz/B?d=START&vht=V_HT&vwt=V_WT"
]
}'>
...
</amp-ad>

Add our URL as shown in the code snippet below. Please replace ORGANIZATION_ID with the Salesforce DMP provided Organization ID, replace REPLACE_SEGS with the DFP targeting key you want to use for Salesforce DMP segments, and replace REPLACE_ID with the DFP targeting key you want to use for the Salesforce DMP global user identifier.

<amp-ad width=300
height=250
type="foo"
rtc-config='{
"urls": [
"https://www.AmpPublisher.biz/A",
"https://www.amptgt.biz/B?d=START&vht=V_HT&vwt=V_WT",
"https://cdn.krxd.net/userdata/v2/amp/ORGANIZATION_ID?segments_key=REPLACE_SEGS&kuid_key=REPLACE_ID"
]
}'>
...
</amp-ad>

 

Validating Salesforce DMP Targeting on AMP Webpages

Open a testing page provided by the client in Google Chrome and open Dev Tools (command-option-i).

  1. Click the “Toggle device toolbar” icon to get the page into a mode where AMP page will serve. Reload the page to make sure the AMP page has served.
  2. Go to the elements tab of Dev Tools.
  3. Search (command-f) for “<amp-ad”, this should get you to the amp-ad tags.
  4. Confirm the amp-ad tags are configured as described in the implementation guide. The most important thing to check for is the presence of our userdata URL in the rtc-config. There might be some backslashes in the URL because the browser escapes certain characters, but that is fine.Google_AMP_Validation_1.png

Confirm that the requests to Salesforce DMP are firing as expected

  1. Go to the network tab of Dev Tools.
  2. Filter the requests for “krxd.net/userdata/v2/amp”.
  3. Click on one of the requests.
  4. Go to the response tab of the panel that pops up.
  5. Confirm that the kuid is returned using the targeting key as specified in the implementation guide. If your current user is a member of segments for the organization, then you should also see segments using the configured targeting key (kxsg by default).

Google_AMP_Validation_2.png

Confirm that targeting is set on the ad slots

  1. Go to the network tab of Dev Tools.
  2. Filter the requests for “doubleclick.net/gamepad/”.
  3. Click on one of the requests.
  4. Go to the headers tab of the panel that pops up.
  5. Look for the scp parameter in the “Query String Parameters” section. The kuid and any segments returned from the server should be present in the following format with whatever other targeting parameters the website is setting on the slot (assuming the targeting keys are kuid and kxsg): kuid=abcdef&kxsg=seg1,seg2,seg3Google_AMP_Validation_3.png

If the site passes the above tests, then the publisher's site is configured properly.

Additional Implementation Support

Salesforce DMP fully recognizes that while the adoption of AMP improves page performance on mobile devices, it creates additional burden for the publisher to create and maintain the AMP specific page infrastructure required to ensure data collection integrity and segment based ad delivery. The publisher is responsible for replicating their existing data transfer infrastructure for AMP pages, and the deployment of the custom iframe for ad delivery, as described here. In addition, it is strongly suggested that the implementation be verified with Salesforce DMP to ensure accurate data collection, analysis and ad display.

Please note that Salesforce DMP is fully committed to supporting publishers' monetization strategies, and if requested can provide publisher specific consulting and implementation and verification services for AMP ad and analytics when requested. Such requests will be treated as Salesforce DMP Change Orders and additional fees may apply.

Need Help?

If you need help with integrating AMP Analytics with Salesforce DMP, don't hesitate to contact the Salesforce DMP Solutions team at [email protected].

Have more questions? Submit a request

0 Comments

Article is closed for comments.