New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@blotoutio/providers-google-analytics-4-sdk

Package Overview
Dependencies
Maintainers
1
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blotoutio/providers-google-analytics-4-sdk - npm Package Compare versions

Comparing version 0.6.5 to 0.6.6

33

index.js
var ProvidersGoogleAnalytics4Sdk = (function () {
'use strict';
const initGA4 = (ID) => {
window.dataLayer = window.dataLayer || [];
window.gtag = function gtag() {
// eslint-disable-next-line prefer-rest-params
window.dataLayer.push(arguments);
};
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
window.gtag('js', new Date());
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
window.gtag('config', ID);
const element = document.createElement('script');
element.async = !0;
element.src = `https://www.googletagmanager.com/gtag/js?id=${ID}`;
const script = document.getElementsByTagName('script')[0];
if (script && script.parentNode) {
script.parentNode.insertBefore(element, script);
}
};
const init = ({ manifest, userId }) => {
if (!manifest.variables || !window || !window.gtag) {
if (!manifest.variables || !window) {
return;
}
window.gtag('config', manifest.variables['googleAnalytics4MeasurementId'], {
user_id: userId,
});
if (!window.gtag && manifest.variables['enableBrowser'] === '1') {
initGA4(manifest.variables['measurementId']);
}
if (window.gtag) {
window.gtag('config', manifest.variables['measurementId'], {
user_id: userId,
});
}
};

@@ -12,0 +37,0 @@

2

package.json
{
"name": "@blotoutio/providers-google-analytics-4-sdk",
"version": "0.6.5",
"version": "0.6.6",
"description": "Google Analytics 4 Browser SDK for EdgeTag",

@@ -5,0 +5,0 @@ "author": "Blotout",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc