Skip to content

Commit 1ab3a19

Browse files
authored
Add getting started to readme (#33)
2 parents 6e95a49 + 65db9e4 commit 1ab3a19

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@ composer require alexwestergaard/php-ga4
3636
- Source: Europe, GDPR, Schrems II
3737
- https://support.google.com/analytics/answer/9019185?hl=en
3838

39+
## Getting started
40+
41+
To get started, you will need two things:
42+
43+
- a data stream can be created under `Admin` > `Data Streams`, get its measurement id eg. `G-8XQMZ2E7TH`
44+
- an API key to send events to the data stream `Admin` > `Data Streams` > Select data stream > `Measurement Protocol API secrets` > `Create`
45+
46+
```php
47+
use AlexWestergaard\PhpGa4\Analytics;
48+
49+
$analytics = Analytics::new('G-8XQMZ2E7TH', 'kU4_0HsvQ8y4itR2ilD94w');
50+
```
51+
3952
## Events
4053

4154
This is a list of prebuilt events as shown in the documentation.

0 commit comments

Comments
 (0)