-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support enhanced conversions #8
Comments
I did some reverse engineering, and it looks like you can build the async function emailToBase64UrlSafeSha256(email) {
const emailBytes = new TextEncoder().encode(email)
const hashBuffer = await crypto.subtle.digest('SHA-256', emailBytes)
const base64String = btoa(String.fromCharCode(...new Uint8Array(hashBuffer)))
return base64String.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '')
}
async function buildEmParam(email) {
const prefix = 'tv.1~em.'
try {
return prefix + await emailToBase64UrlSafeSha256(email)
} catch(e) {
return prefix + 'e2'
}
} There are a few other error codes with other validations, but the main idea is there's some prefix, and base 64 URL safe SHA-256 of the lowercase email. It also appears that another param was added |
Thanks @wuservices ! we're looking into this, actually trying to get some insights from Google on how exactly this should be implemented. hopefully will be implemented in next few weeks. |
@bjesus That's great news, and I'm glad you can work with them so we're not just guessing. Supporting other fields besides email would be great too. FWIW I was able to use this logic with a Worker Variable and reconfigured Google Ads Enhanced Conversations to gtag and the alert on our account went away. I saw that there was also an API based option and I was wondering if that was a better match for Zaraz to send server side, or why not use the API for all Google Ads logic instead of the client? |
@wuservices , I think it refer to the enhanced conversions implementation mode, with "m" = "manual". If I choose the "code" implementation, ec_mode=c. |
any news on this? |
Allow additional attributes to be passed in and hashed for enhanced conversions. This will improve matching for ads by passing in known data about the user.
The Google documentation defines what fields can be passed in, and they could be pre-hashed with SHA256. The exact data format of the API request isn't clear from the docs, but in the validate your implementation section, it mentions the
em
parameter will be added:The text was updated successfully, but these errors were encountered: