Container Tag Implementation (AMP Pages)
Note: some of the capabilities of the common container tag are lost due to this AMP format, such as user synchronization with other platforms. For more information, contact your Retargetly account agent.
The Retargetly container tag for AMP Pages allows you to collect, segment and activate the users who browse your website in this format.
- On the DMP platform:
To create a container tag, what you need to do is go to the "Sources" tab inside your DMP account, and create a "Web" type Source:
At the end of the creation flow, you will get a code similar to this:
From this container tag we only need to know two values: the pid and the src. For example those in the image are 1 and 0 respectively. Once we have them, we move on to the implementation of the amp-analytics code within the website.
- In the website code:
Inside the <head> </head> tag. For the site to work in AMP mode, previously the site must have been incorporated with the basic AMP script:
<script async src="https://cdn.ampproject.org/v0.js"></script>
In addition to this script, we must incorporate (if it is not yet present) a code to load amp-analytics libraries, the interface through which the integration of third-party platforms within the site is made possible:
<script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
- Inside the <body> </body> tag
Finally, within the body of the site we will incorporate the corresponding code to Retargetly:
<amp-analytics data-credentials="include" type="retargetly" id="retargetly" config="https://api.retargetly.com/amp/config.json">
<script type="application/json">
{
"vars": {
"accountId": PID,
"sourceId": SID
},
"extraUrlParams": {
"tags": "esto,es,un,ejemplo"
}
}
</script>
</amp-analytics>
Within the "vars" property, we have to replace PID and SID with the values obtained above within the DMP platform.
The values within the "extraUrlParams" property are optional, and serve to send different types of data to the DMP. These same properties are those that can be sent with the common container tag:
Tags
Key: tags
Value: (comma separated text, where each of the attributes is a label)
User Gender
Key: gender
Values: 'F' or 'M' (F reports female gender, M reports male gender).
User age (choose only one of these options)
Key: age
Values: (current age of the user. Ex: 35).
Key: born
Values: (year of birth of the user. Ex: 1987)
Key: date
Values: (date of birth in yyyymmdd format. Ex: 19890319).
- User Contact Information
The DMP platform allows the storage of user contact data securely through hash storage. A hash on an attribute (e-mail, telephone, national identifier) is an indecipherable value, which cannot be decrypted (the original value can never be obtained again). When the DMP platform receives contact information, that hashed attribute is always saved in the SHA256 and SHA512 formats (without private key).
In this way, suppose the following scenario:
The email to info@retargetly.com is sent. The DMP platform will effectively store two values:
Value in SHA256: 0e06ca8fb7433001b38b189ad677e591f44a934e50c771112179df4c93f53ad5
Value in SHA512: c9302ce11aaf5a813296b7576fec7fb13256a2ee08b9d2fd194979a556f7a4dc8fee4010625d766761be6ab3e0575ae27117dfbbd49c3983b147c39f4efc0272e
To send user contact information then you can use the same JavaScript code from the beginning, but over the following variables:
(In the event that the value is sent already hashed, the same list prior to the hashing need to have a specific format. In that case, it is specified as "Format" in the list below. If present, it is mandatory that when send with the specified format, otherwise the DMP may lose a % of match rate by wanting to overflow user lists by contact data)
- To send e-mail information:
Password: ml_raw
Value: (unformatted user email)
Password: ml_sh2
Value: (user email in SHA256 format)
Format: all lowercase
Password: ml_sh5
Value: (user email in SHA512 format)
Format: all lowercase
- To send cell phone number information:
Password: mb_raw
Value: (unformatted user cell)
Password: mb_sh2
Value: (user cell phone in SHA256 format)
Format: country code + area code without zeros + subscriber number. Only numbers, there are no special characters or spaces in the middle. Example: 541151190123
Password: mb_sh5
Value: (user cell phone in SHA512 format)
Format: country code + area code without zeros + subscriber number. Only numbers, there are no special characters or spaces in the middle. Example: 541151190123
- To send national identifier information:
Password: nid_raw
Value: (national identifier of the unformatted user)
Password: nid_sh2
Value: (national user identifier in SHA256 format)
Format: no space characters or spaces
Password: nid_sh5
Value: (national user identifier in SHA512 format)
Format: no space characters or spaces