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

Commit 0142475

Browse files
committed
Update README.md
1 parent ccef7a6 commit 0142475

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,19 @@ GOOGLE_ANALYTICS_TRACKING_ID=UA-01234567-89
4141

4242
## Blade Directive
4343

44-
This package comes with a `@sendAnalyticsClientId` directive that stores the `Client ID` from the GA front-end to your Laravel backend. It uses the [Axios HTTP library](https://github.com/axios/axios) the make an asynchronous POST request. Axios was choosen as it is provided by default in Laravel in the `resources/js/bootstrap.js` file.
44+
This package comes with a `@sendAnalyticsClientId` directive that stores the `Client ID` from the GA front-end to your Laravel backend.
45+
46+
It uses the [Axios HTTP library](https://github.com/axios/axios) the make an asynchronous POST request. Axios was choosen as it is provided by default in Laravel in the `resources/js/bootstrap.js` file.
47+
48+
Add the directive somewhere after initializing/configuring GA. The POST request will only be made if the `Client ID` isn't stored yet or when it's refreshed.
4549

4650
```php
4751
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-01234567-89"></script>
4852
<script>
4953
window.dataLayer = window.dataLayer || [];
5054
function gtag(){dataLayer.push(arguments);}
5155
gtag('js', new Date());
52-
gtag('config', 'UA-01234567-89', { 'anonymize_ip': true, 'forceSSL': true });
56+
gtag('config', 'UA-01234567-89');
5357
5458
@sendAnalyticsClientId
5559
</script>

0 commit comments

Comments
 (0)