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
{{ message }}
This repository was archived by the owner on Jan 2, 2024. It is now read-only.
Laravel package to easily send events to Google Analytics
10
10
11
11
## Features
12
+
* Use [Laravel Events](https://laravel.com/docs/7.x/events) to track events with Google Analytics
13
+
* All API calls are queued.
12
14
* Compatible with Laravel 6.0 and 7.0.
13
15
* PHP 7.4 required.
14
16
@@ -65,9 +67,9 @@ class OrderWasPaid implements ShouldBroadcastToAnalytics
65
67
66
68
There are two additional methods that lets you customize the call to Google Analytics.
67
69
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.
69
71
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.
71
73
72
74
```php
73
75
<?php
@@ -103,6 +105,17 @@ class OrderWasPaid implements ShouldBroadcastToAnalytics
103
105
}
104
106
```
105
107
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)
0 commit comments