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

Commit 23f340e

Browse files
committed
Update sendCliendId.blade.php
1 parent 1472c02 commit 23f340e

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed
Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
ga(function () {
2-
var clientId = ga.getAll()[0].get('clientId');
1+
if (typeof ga !== 'undefined') {
2+
ga(function () {
3+
var clientId = ga.getAll()[0].get('clientId');
34

4-
if(clientId != @json(app('analytics-event-tracking.client-id'))) {
5-
window.axios.post('/gaid', { id: clientId });
6-
}
7-
});
5+
if (clientId != @json(app('analytics-event-tracking.client-id'))) {
6+
window.axios.post('/gaid', { id: clientId });
7+
}
8+
});
9+
} else {
10+
gtag('get', @json(config('analytics-event-tracking.tracking_id')), 'client_id', function (clientId) {
11+
if (clientId != @json(app('analytics-event-tracking.client-id'))) {
12+
window.axios.post('/gaid', { id: clientId });
13+
}
14+
});
15+
}

0 commit comments

Comments
 (0)