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
> European Union have noticed that default setup of Google Analytics does not comply with GDPR as data is sent unrestricted to an american service possibly outside of Europe.
38
-
>
39
-
> This includes the use of `gtag.js`/`gtm.js` as JavaScript pushes the request from visitors device including their IP-Address. Server Side Tracking, however, does only send information specified inside the body and about your server.
40
-
>
41
-
> Relying solely on Google Analytics 4 Events - that is not pushed through the `gtag.js`/`gtm.js` script - can be scraped of GDPR-related information.
37
+
European Union have noticed that default setup of Google Analytics does not comply with GDPR as data is sent unrestricted to an american service possibly outside of Europe.
38
+
This includes the use of `gtag.js` as JavaScript pushes the request from visitors device including their IP-Address.
39
+
40
+
Server Side Tracking, however, does only send information specified inside the body and about your server.
41
+
42
+
Relying solely on Google Analytics 4 Events - that is not pushed through the `gtag.js` script - can be scraped of GDPR-related information.
To setup Analytics you need a Measurement ID and API Secret.
50
+
51
+
Go to `Administrator` (bottom left) and then select your `Account` -> `Data Streams` -> your stream.
52
+
Here you will find `Measurement-ID` at top from and further down `Api Secrets for Measurement Protocol`, in there you can create yourself an `API Secret`.
49
53
50
-
- a data stream can be created under `Admin` > `Data Streams`, get its measurement id eg. `G-XXXXXXXX`
51
-
- an API key to send events to the data stream `Admin` > `Data Streams` > Select data stream > `Measurement Protocol API secrets` > `Create`
54
+
**PLEASE** note that Google Analytics will look out from traffic gathered by the `gtag.js` library, as Server Side Events are supposed to supplement the frontend through its `_ga`/`_gid` cookie sessions.
This is a list of prebuilt events as shown in the documentation.
68
+
This is a list of prebuilt events as shown in the documentation. All events have the following parameters to locate trigger location of each event or if they were related to any campaigns/referrals.
// Note each event is its own object inside an array as
181
+
// this allows to pass the same event type multiple times
182
+
{
183
+
addToCart: {
184
+
currency:'EUR',
185
+
value:13.37,
186
+
items: [
187
+
{
188
+
'item_id':1,
189
+
'item_name':'Cup',
190
+
'price':13.37,
191
+
'quantity':1
192
+
}
193
+
]
194
+
}
163
195
}
164
-
}
165
-
])
196
+
]
197
+
)
166
198
```
167
199
168
200
#### Backend
@@ -189,7 +221,7 @@ try {
189
221
190
222
## Custom Events
191
223
192
-
You can build your own custom events. All you need is to implement and fullfill the `AlexWestergaard\PhpGa4\Facade\Type\Event` facade/interface. If you want ease of life features, then you can extend your event from `AlexWestergaard\PhpGa4\Helper\AbstractEvent` and overwrite as you see fit.
224
+
You can build your own custom events. All you need is to implement and fullfill the `AlexWestergaard\PhpGa4\Facade\Type\EventType` facade/interface. If you want ease of life features, then you can extend your event from `AlexWestergaard\PhpGa4\Helper\EventHelper` and overwrite as you see fit.
0 commit comments