AMP Implementation for TCF Version 2

Overview

This document provides guidance on how to integrate the Sourcepoint CMP (Consent Management Platform) with your AMP (Accelerated Mobile Pages) inventory for the IAB's Transparency and Consent Framework version 2.0. To perform this integration you should have some level of technical knowledge 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 the 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 Creating Properties 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.

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 A Scenario

Setting up a scenario for AMP is a little different than other consent campaigns. This difference is because the AMP component will determine on its own whether consent has been previous given by the user. The scenario within a consent campaign for AMP, therefore, should not include a consent gate.

Please be aware that Consent Gate scenario steps should not be used for AMP implementations.

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

If you are using the <amp-geo> component, do not add geo restrictions to the scenarios you are using with amp campaigns.

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 as for other messaging campaigns. Please see the sections listed below for more information.

Setting Up Vendor Lists And Privacy Managers

There is 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. AMP does not allow Javascript to be run in the AMP context, so consent and reject actions will not work.

Setting up the CNAME DNS Record

‌In order for the AMP consent to be persistently recorded for people using Safari, we need to set the consent preferences in the first-party space. To accomplish this, you need to set up a CNAME DNS record to include in the <amp-consent> configuration.

Please read the Setting Up the CNAME DNS Record for Single CNAME article on setting up a CNAME record for this solution.

Integrating Sourcepoint CMP Code Into Your AMP Website for TCF Version 2.0

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 is for an example campaign running in the Sourcepoint account. It uses a CNAME record of sp-cdn.example.com with the respective accountId, siteName, siteId and privacyManagerId values for that account. If you swap your subdomain for the values related to your account you will be able to display messages. You MUST use your own CNAME record in order for the solution to work properly.

<amp-consent id='consent' layout='nodisplay' >
<script type="application/json">
{
"consentRequired": "remote",
"consentInstanceId": "SourcePoint",
"checkConsentHref": "https://sp-cdn.example.com/wrapper/tcfv2/v1/amp",
"promptUISrc": "https://sp-cdn.example.com/amp/index.html?authId=CLIENT_ID",
"postPromptUI": "consent-ui",
"clientConfig": {
"accountId": 222,
"mmsDomain": "https://sp-cdn.example.com",
"propertyHref": "https://amp.property.tcfv2",
"propertyId": 1234,
"privacyManagerId": 987654,
"isTCFV2": true,
"pmTab": "purposes",
"stageCampaign": false,
"targetingParams": {
"color": "red"
}
}
}
</script>
</amp-consent>

Below are the definitions for the parameters you need to deliver a TCF v2 AMP solution.

  • consentRequired - This tells the AMP consent component to use code from a remote source. This should always be set to "remote"

  • consentInstanceId - This tells the AMP consent component to use the Sourcepoint code. This should always be set to "sourcepoint".

  • checkConsentHref - This URL that will check the user's consent. The path for this URL will leverage the CNAME record from the "Setting up the CNAME DNS Records" section of the document. The format of the URL path is https://{CNAME SUBDOMAIN}/wrapper/tcfv2/v1/amp where {CNAME SUBDOMAIN} would be replaced by the CNAME subdomain record created.

  • promptUISrc - This is the URL that will return the post prompt user interface where user's can change their consent. The path should always be set to "https://{CNAME SUBDOMAIN}/amp/index.html" where {CNAME SUBDOMAIN} would be replaced by the CNAME subdomain record previously created.

  • postPromptUI - This is the page element that should be displayed to users to provide them with the ability to change their consent after they initially consent.

  • accountId - This corresponds with your Sourcepoint account ID.

  • mmsDomain - This is the domain that will communicate with the Sourcepoint messaging service. The format for the path of this parameter is https://{CNAME SUBDOMAIN} where {CNAME SUBDOMAIN} would be replaced by the CNAME subdomain record previously created.

  • propertyHref - This is the property created in the Sourcepoint UI that contains the message, scenario, partition and campaign. The property name should be preceded by the "https://" protocol. For example, a property defined as "amp.property.tcfv2" in the UI should have a propertyHref parameter of "https://amp.property.tcfv2".

  • propertyId - The ID of the property on which the message is supposed to be served. You can get the property from the address bar at the end of the URL.

Please include the ?authId=CLIENT_ID url parameter in the promptUISrc entry. This will allow consent preferences to be saved when your users arrive from a search.

  • privacyManagerId - The ID of the privacy manager to be associated with the postPromptUI element. The ID of the privacy manager can be obtained from the Privacy Manager create window (see screenshot below).