@blotoutio/providers-google-analytics-4-sdk 0.10.1 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +6 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -19,9 +19,7 @@ var ProvidersGoogleAnalytics4Sdk = (function () {
|
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
const init = ({ manifest, userId }) => {
|
|
22
|
-
if (!window ||
|
|
23
|
-
!manifest.variables ||
|
|
24
|
-
manifest.variables['type'] === 'DYNAMIC') {
|
|
22
|
+
if (!window || !manifest.variables) {
|
|
25
23
|
return;
|
|
26
24
|
}
|
|
27
25
|
if (!window.gtag) {
|
|
@@ -169,13 +167,14 @@ var ProvidersGoogleAnalytics4Sdk = (function () {
|
|
|
169
167
|
}
|
|
170
168
|
};
|
|
171
169
|
|
|
172
|
-
const tag = ({ data, eventName
|
|
173
|
-
|
|
170
|
+
const tag = ({ data, eventName }) => {
|
|
171
|
+
const isLoaded = window && window.gtag && !!getCookieValue('_ga');
|
|
172
|
+
if (isLoaded) {
|
|
174
173
|
handleTag({ data, eventName });
|
|
175
174
|
}
|
|
176
175
|
return {
|
|
177
|
-
loaded:
|
|
178
|
-
sdkVersion: "0.10.
|
|
176
|
+
loaded: isLoaded,
|
|
177
|
+
sdkVersion: "0.10.3" ,
|
|
179
178
|
};
|
|
180
179
|
};
|
|
181
180
|
|