DEPRECATED_AMP Implementation Overview v1.1 with CNAME

As TCF v1 is being sunset as of August 15th, 2020, we do not recommend creating any new TCF v1.1 AMP implementations. Please refer to the instructions for the latest version of the TCF linked below instead.

This document provides guidance on how to integrate the Sourcepoint CMP (Consent Management Platform) with your AMP (Accelerated Mobile Pages) inventory. To perform this integration you should have some level of technical knowledge, be able to update your Sourcepoint configuration to add AMP Properties, and access to update the AMP website code.

The process for setting messages, scenarios, partitions and campaigns is the same as the process for setting up any consent messaging campaign. However, the process for setting up properties, vendor lists and privacy manager may differ.

Setting Up An AMP Property

The process for setting up an AMP property is generally the same as the process for setting up a property for any other messaging campaign. It is recommended that you set up an alternate property to deliver messages on AMP pages. This will allow you to set up separate vendor lists for AMP pages. Examples of an AMP property name for the site www.example.com would be www.amp.example.com and amp.example.com.

For more information on how to create a new property, please visit the "How to Add A Property" article.

Setting Up A Message

Messages for AMP are created using the Sourcepoint's new Message Builder 2 product. For more information on creating a message using Message Builder 2, please visit the "How to Create a Message Version" in version 2 of the messaging section.

Setting Up A Scenario

Setting up a scenario is a little different than other consent campaigns. The scenario for a consent campaign should not include a consent gate. The AMP consent component itself will determine whether or not consent has been previously given by the user.

You can learn more about setting up a scenario by reading the How to Create A Scenario article.

Setting Up A Partition and Campaign

The steps for setting up a partition and campaign are nearly the same as the steps for creating partitions and campaigns for any messaging campaign. Please see the sections listed below for more information.

Setting Up Vendor Lists And Privacy Managers

There is only one minor difference in setting up a vendor list for AMP pages. For AMP pages, you should not create any consent or reject actions in vendor lists.

Setting up the CNAME DNS Records

In order for the AMP consent to be persistently recorded in Safari we need to set the consent preferences in the first-party space. To accomplish this, you need to set up two CNAME DNS records.

API CNAME - The API CNAME record is for our consent server APIs where the consent record is stored. The CNAME should be set up so that it points to sourcepoint.mgr.consensu.org.

CDN CNAME - The CDN CNAME is for the post prompt user interface where users can change their consent preferences. The second CNAME record should point to amp.pm.sourcepoint.mgr.consensu.org. This CNAME will ensure that consent choices made from the post prompt user interface (privacy manager) are executed in a first-party space.

Both of these CNAME records will be referenced in the checkConsentHref and promptUISrc parameters of the configuration code.

Integrating Sourcepoint CMP Into Your AMP Website

After you have created a property in the Sourcepoint user interface, you can integrate the Sourcepoint CMP into your AMP website by using the amp-consent component, and inserting the proper attributes in the amp-consent component tags. The example code below will display a demo message on a test page. To configure the code to show a message from your account, you would change the parameters listed to correspond to your account set up.

  • consentRequired - a required parameter that indicates a third-party AMP solution is being used.

  • consentInstanceId - required field that points to the sourcepoint AMP solution.

  • checkConsentHref - the API CNAME URL that points to the sourcepoint.mgr.consensu.org domain and API. As mentioned above, you must provide your own 1st party CNAME URL in order for the solution to work properly in Safari on iOS and macOS. The format of this parameter is as follows: https://{API CNAME DOMAIN}/wrapper/tcfv2/v1/amp where {API CNAME DOMAIN} would be replaced by your first-party CNAME domain for APIs.

  • promptUISrc - the CDN CNAME URL that points to the amp.pm.sourcepoint.mgr.consensu.org domain. As mentioned above, you must provide your own 1st party CNAME URL in order for the solution to work properly in Safari on iOS and macOS. The format of this parameter is as follows: https://{CDN CNAME DOMAIN}/amp/index.html where {CDN CNAME DOMAIN} would be replaced by the first-party CNAME record set up for CDN URLs.

  • accountId - this corresponds to the account ID in the Sourcepoint UI.

  • siteName - this attribute is the same as the property name set up in the "Setting Up An AMP Property" above in this document.

  • siteId - this attribute is optional and corresponds to the ID of the property being used.

  • mmsDomain - This is the API CNAME set up in the Setting up the CNAME DNS Records section above. The format for this parameter is https://{API CNAME DOMAIN} where {API CNAME DOMAIN} would be replaced by your first-party CNAME domain for APIs.

  • privacyManagerId - this attribute corresponds to the ID of the privacy manager used for this site. You can find a privacy manager's ID by selecting the privacy manager in the Sourcepoint UI and grabbing the ID from the URL. In the screenshot below the ID for the privacy manager is 5d6ed64c47211424d802074d.

  • targetingParams - this is optional, but if you want to provide additional key-value pair targeting variables to customize language or create a more relevant user experience would be listed here. In the example below, the key would be "foo" and the value would be "bar".

  • postPromptUI - this is the reference to on-page element that will display after a user has provided consent. When this element appears a user can click on it to change their consent preferences.

The example code below is for an example campaign running in the Sourcepoint account. It uses a API CNAME record of sp-api.sp-demo.com and a CDN CNAME record of sp-cdn.sp-demo.com with respective accountId, siteName, siteId and privacyManagerId values for that account. If swap out these values for the values related to your account, API CNAME and CDN CNAME you should be able to display messages. You MUST use your own CNAME records in order for the solution to work properly.

<amp-consent id='consent' layout='nodisplay' type='SourcePoint'>
<script type="application/json">
{
"consentRequired": "remote",
"consentInstanceId": "sourcepoint",
"checkConsentHref": "https://sp-api.sp-demo.com/wrapper/tcfv2/v1/amp",
"promptUISrc": "https://sp-cdn.sp-demo.com/amp/index.html",
"postPromptUI": "privacy-settings-prompt",
"clientConfig": {
"accountId": 22,
"mmsDomain": "https://sp-api.sp-demo.com",
"siteName": "amp.demo",
"siteId": 4400,
"privacyManagerId": "5d566301ab45d123ed973688",
"targetingParams": {
"foo": "bar"
}
}
}
</script>
<div id="privacy-settings-prompt">
<button on="tap:consent.prompt(consent=SourcePoint)">Privacy Settings</button>
</div>
</amp-consent>

Consent Framework Support

The IAB consent string is collected and passed into AMP pages; however, all vendors are either consented to or rejected. At this time, AMP pages do not support granular opt-in/opt- out for individual vendors and purposes. You should check with your vendors to confirm that they have updated their support for the IAB framework.

Working with Non-IAB Vendors and Elements on Site

Non-IAB vendors are handled by adding the data-on-block-consent attribute to any tag. Below is an example of a tag for Google Analytics.

<amp-analyticsdata-block-on-consent 2
type="googleanalytics">
</amp-analytics>

Creating The postPrompt UI

The postPrompt UI is the button a user can click on the resurface a privacy manager after the user has made a consent choice. The UI is constructed from available AMP HTML elements directly on the page. After the user has interacted with the consent message, the postPromptUI will be displayed. The elements for the postPrompt UI need to placed within the the <amp-consent> component.

Creating a Stage Campaign

Prior to launching the campaign to the general public, you can create a campaign in a stage environment to test the consent experience on a production site. To do this, you set the "stageCampaign": true. This allows you to test the user experience in a production environment without exposing the campaign to the general public.