tl;dr: Should there be a sha256_ prefix to city, regon, postal code, country, and should I hash them or not?
—- details
I am wondering wether google doesn’t consider city, region and postal code a sensitive information or the docs are incomplete. Judging by the second example, I don’t need to hash even street address. And yet I believe I should hash everything…
[Using smarty in the examples]
gtag('set', 'user_data', {
"sha256_email_address": "{hash('sha256', $order_info.email)}",
"address": {
"sha256_first_name": "{hash('sha256', $order_info.firstname)}",
"sha256_last_name": "{hash('sha256', $lastname)}",
"sha256_street": "{hash('sha256', $address)}",
"sha256_city":"{hash('sha256', $city)}",
"sha256_region":"{hash('sha256', $country)}",
"sha256_postal_code": "{hash('sha256', $zipcode)}",
"sha256_country": "{hash('sha256', $country)}"
}
});
**Resources: **
https://support.google.com/analytics/answer/14171598
https://developers.google.com/analytics/devguides/collection/ga4/uid-data
"sha256_city":"{hash('sha256', $city)}",
vs
"city":"{hash('sha256', $city)}",
vs
"city":"{$city}",