.png)
Amazon Advertising tag supports the use of your customers’ “hashed” email addresses as an alternative ad identifier to the standard browser cookie
<aside> <img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/fcb5a1f3-6d17-4aa0-adac-91771380b23c/BLANK_ICON.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/fcb5a1f3-6d17-4aa0-adac-91771380b23c/BLANK_ICON.png" width="40px" /> With the tag base code added to the page, to include hashed email as an alternative ad-identifier with your event, you can call the JavaScript API with 3 methods. Each of these ad-identity methods requires an identity token to be configured. Token configuration code can be added to the head of the page if you have access to your customers’ emails at page load time. You can also be added it in-line if emails are collected on the specific page. Here’s a valid token configuration ⬇️
</aside>
const tokenConfig = {
gdpr: {
enabled: false, // GDPR is mandatory for EU region token request.
consent: '', // Valid IAB consent string, v1 or v2 (required if `enabled` is `true`)
},
hashedRecords: [{
type: 'email',
record: 'aa33a69554a987bff19300338c26ddcb8dd5f99e88183080b41683f9f280e4c9', //SHA256 Hash Required
}],
ttl: 9600, // token TTL in seconds
};
After creating an identity token, the identity JavaScript methods may be called.
To renew the token
amznToken=sampleTokenValue.
renewToken(tokenConfig);
Here is the complete code including the identity config:
const tokenConfig = {
gdpr: {
enabled: false, // GDPR is mandatory for EU region token request.
consent: '', // Valid IAB consent string, v1 or v2 (required if `enabled` is `true`)
},
},
hashedRecords: [{
type: 'email',
record: 'aa33a69554a987bff19300338c26ddcb8dd5f99e88183080b41683f9f280e4c9',
}],
ttl: 9600, // token TTL in seconds
};
renewToken(tokenConfig);
To update the token
amznToken=sampleTokenValue. A valid token requires valid token request configurations, which are specified above.updateToken(tokenConfig);
To delete the token
deleteToken();