You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-28Lines changed: 40 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,11 +65,26 @@ $analytics = Analytics::new(
65
65
api_secret: 'xYzzX_xYzzXzxyZxX',
66
66
debug: true|false
67
67
);
68
+
69
+
// You can set CONSENT here if not done through the gtat.js
70
+
// Read full docs here: https://support.google.com/tagmanager/answer/13802165
71
+
$consent = $analytics->consent(); // returns a consent handler
72
+
73
+
// Sets consent for sending user data from the request's events
74
+
// and user properties to Google for advertising purposes.
75
+
$consent->setAdUserDataPermission();
76
+
$consent->getAdUserDataPermission();
77
+
$consent->clearAdUserDataPermission();
78
+
79
+
// Sets consent for personalized advertising for the user.
80
+
$consent->setAdPersonalizationPermission();
81
+
$consent->getAdPersonalizationPermission();
82
+
$consent->clearAdPersonalizationPermission();
68
83
```
69
84
70
85
### Data flow
71
86
72
-
`session_id` > Google Analytics does not specify a required type of **session or user id**. You are free to use any kind of **unique identifier** you want; the catch, however, is that Google Analytics populates some internal data with `gtag.js`, that is then referenced to their `_ga` cookie session id. Just be aware that `gtag.js` is using *client-side Javascript* and can therefore have some **GDPR complications** as requests back to Google Analytics contains client information; such as their IP Address.
87
+
`session_id` > Google Analytics does not specify a required type of **session or user id**. You are free to use any kind of **unique identifier** you want; the catch, however, is that Google Analytics populates some internal data with `gtag.js`, that is then referenced to their `_ga` cookie session id. Just be aware that `gtag.js` is using _client-side Javascript_ and can therefore have some **GDPR complications** as requests back to Google Analytics contains client information; such as their IP Address.
73
88
74
89
1. Acquire proper GDPR Consent
75
90
2. Client/GTAG.js sends session_start and first_visit to GA4
0 commit comments