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
- Removes Helper/Helper class
- Constants moved into Facades, Helpers moved into Helper/Converter
- Removes Model/*.php classes
- Removes root GA4Exception.php
- Updates Composer.json to better represent model and tested packages/PHP-Versions
- Updates workflow to only test on Linux (Windows too slow)
- Adds Type Facades to expected functionality and simplicy Paramter Type Expectation
- Adds ArrayAccess and Iterator to classes with magic-references to set_ or add_ methods
- Adds further Exceptions for more specific tryCatch optionality
- Adds better testing of functionality, both core classes and Events
- Adds output of PHPUnit Coverage in actions (No further usage atm)
- Moves Facades into subfolder named Group/
- Deprecated badly named and bad usage methods
* Requires custom events to be updated to implement `AlexWestergaard\PhpGa4\Facade\Type\Event` or extend `AlexWestergaard\PhpGa4\Helper\AbstractEvent`
* Requires tryCatch to to use `AlexWestergaard\PhpGa4\Exception\Ga4Exception` for all exceptions thrown inside this library
-[Frontend to Backend communication](#frontend-to-backend-communication)
17
-
-[Custom Events](#custom-events)
18
-
-[Documentation](#documentation)
19
-
20
-
**LEGACY WARNING**
7
+
```sh
8
+
composer require alexwestergaard/php-ga4
9
+
```
10
+
11
+
-[LEGACY](#legacy)
12
+
13
+
14
+
## LEGACY
21
15
-`PHP 7` should only use `1.0.*` versions of this library
22
16
23
17
## GDPR Notice
24
18
25
-
*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. This includes the use of 'GTAG.js' as JavaScript pushes the request from visitors device including IP-Address. Server Side Tracking, however, does only send information specified inside the body and of your server. Relying solely on Google Analytics 4 Events - that is not pushed through the GTAG.js script - can be scraped of GDPR-related information.*
19
+
> 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.
20
+
>
21
+
> 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.
22
+
>
23
+
> 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.
@@ -72,120 +70,107 @@ This is a list of prebuilt events as shown in the documentation.
72
70
## Frontend & Backend Communication
73
71
74
72
This library is built for backend server side tracking, but you will probably trigger most events through frontend with Javascript or Websockets. There will be 2 examples, one as pure backend for logged/queued events and one for frontend to backend communication.
// Exceptions might be stacked, check: $exception->getPrevious();
175
156
}
176
157
```
177
158
178
159
## Custom Events
179
160
180
-
You can build your own custom events, but be careful to follow this structure. It is important that you extend the Model\Event class because Analytics checks inheritance towards that class on addEvent.
161
+
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.
0 commit comments