Skip to content
This repository was archived by the owner on Jan 2, 2024. It is now read-only.

Commit 3a3863a

Browse files
committed
Docs
1 parent f9aacb7 commit 3a3863a

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ https://twitter.com/pascalbaljet/status/1257926601339277312
99
Laravel package to easily send events to Google Analytics
1010

1111
## Features
12+
* Use [Laravel Events](https://laravel.com/docs/7.x/events) to track events with Google Analytics
13+
* All API calls are queued.
1214
* Compatible with Laravel 6.0 and 7.0.
1315
* PHP 7.4 required.
1416

@@ -65,9 +67,9 @@ class OrderWasPaid implements ShouldBroadcastToAnalytics
6567

6668
There are two additional methods that lets you customize the call to Google Analytics.
6769

68-
With the `withAnalytics` you can interact with the [underlying package](https://github.com/theiconic/php-ga-measurement-protocol) to set additional parameters. Take a look at the `TheIconic\Tracking\GoogleAnalytics\Analytics` class to see the available methods.
70+
With the `withAnalytics` method you can interact with the [underlying package](https://github.com/theiconic/php-ga-measurement-protocol) to set additional parameters. Take a look at the `TheIconic\Tracking\GoogleAnalytics\Analytics` class to see the available methods.
6971

70-
With the `broadcastAnalyticsActionAs` you can customize the name of the [Event Action](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#eventAction). By default we use the class name with the class's namespace removed. This method gives you access to the underlying `Analytics` class as well.
72+
With the `broadcastAnalyticsActionAs` method you can customize the name of the [Event Action](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#eventAction). By default we use the class name with the class's namespace removed. This method gives you access to the underlying `Analytics` class as well.
7173

7274
``` php
7375
<?php
@@ -103,6 +105,17 @@ class OrderWasPaid implements ShouldBroadcastToAnalytics
103105
}
104106
```
105107

108+
## Additional configuration
109+
110+
You can configure some additional settings in the `config/analytics-event-tracking.php` file:
111+
112+
* `use_ssl`: Use SSL to make calls to GA
113+
* `anonymize_ip`: Anonymize IP when making calls to GA
114+
* `send_user_id`: Send the ID of the authenticated user to GA
115+
* `queue_name`: Specify a queue to make the calls to GA
116+
* `client_id_session_key`: The session key to store the Client ID
117+
* `http_uri`: HTTP URI to post the Client ID to (from the Blade Directive)
118+
106119
### Testing
107120

108121
``` bash

config/config.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22

33
return [
44
/**
5-
* Your Google Analytics Tracking ID.
5+
* Your GA Tracking ID.
66
* https://support.google.com/analytics/answer/1008080
77
*/
88
'tracking_id' => env('GOOGLE_ANALYTICS_TRACKING_ID'),
99

1010
/**
11-
* Use SSL to make calls to Google Analytics.
11+
* Use SSL to make calls to GA.
1212
*/
1313
'use_ssl' => true,
1414

1515
/**
16-
* Anonymize IP when making calls to Google Analytics.
16+
* Anonymize IP when making calls to GA.
1717
*/
1818
'anonymize_ip' => true,
1919

2020
/**
21-
* Send the ID of the authenticated user to Google Analytics.
21+
* Send the ID of the authenticated user to GA.
2222
*/
2323
'send_user_id' => true,
2424

2525
/*
26-
* This queue will be used to perform the API calls to Google Analytics.
26+
* This queue will be used to perform the API calls to GA.
2727
* Leave empty to use the default queue.
2828
*/
2929
'queue_name' => '',
@@ -34,7 +34,7 @@
3434
'client_id_session_key' => 'analytics-event-tracker-client-id',
3535

3636
/**
37-
* HTTP URI to store the Client ID.
37+
* HTTP URI to post the Client ID to (from the Blade Directive).
3838
*/
3939
'http_uri' => '/gaid',
4040
];

0 commit comments

Comments
 (0)