Skip to content

Commit 20d1235

Browse files
committed
update README
1 parent 6c5e401 commit 20d1235

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Server Side Tagging is not supposed to replace the frontend Client and session i
4949
4. Server uses `_ga` (or `_gid`) to send/populate events
5050
- Eg. GenerateLead, Purchase, Refund and other backend handled events.
5151

52-
Note: It is entirely possible to push events to backend without acquiring the session cookies from Google Analytics; you will, however, lose information bundled inside the `GTAG.js` request if you do not figure out how to push that via backend too. You can replace the `_ga` and `_gid` sessions with your own uniquely generated id.
52+
Note: It is entirely possible to push events to backend without acquiring the session cookies from Google Analytics; you will, however, lose information bundled inside the `gtag.js` request if you do not figure out how to push that via backend too. You can replace the `_ga` and `_gid` sessions with your own uniquely generated id.
5353

5454
All requests should follow this structure and contain at least 1 event for Google Analytics to accept it.
5555

@@ -89,7 +89,7 @@ $event->setPageReferrer(string $var);
8989
$event->setPageTitle(string $var);
9090
$event->setScreenResolution(string $var);
9191
// Fillable for multiple events
92-
$eventPage = AlexWestergaard\PhpGa4\Helper\EventParamsHelper();
92+
$eventPage = AlexWestergaard\PhpGa4\Helper\EventParamsHelper(...);
9393
$event->setEventPage($eventPage);
9494
```
9595

@@ -134,18 +134,19 @@ $event->setEventPage($eventPage);
134134

135135
## Frontend & Backend Communication
136136

137-
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.
137+
This library is built for backend server side tracking, but you will probably trigger most events through frontend with Javascript or Websockets.
138+
There will be 2 examples, one as pure backend for logged/queued events and one for frontend to backend communication.
138139

139140
### Logging / Queue
140141

141142
```php
143+
// require vendor/autoload.php
144+
142145
use AlexWestergaard\PhpGa4\Exception;
143146
use AlexWestergaard\PhpGa4\Analytics;
144147
use AlexWestergaard\PhpGa4\Event;
145148
use AlexWestergaard\PhpGa4\Item;
146149

147-
// require vendor/autoload.php
148-
149150
$visitors = getVisitorsAndEvents(); // pseudo function, make your own logic here
150151

151152
foreach ($visitors as $collection) {

0 commit comments

Comments
 (0)