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

@volenday/google-analytics

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@volenday/google-analytics - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

29

index.js

@@ -1,2 +0,1 @@

const shortid = require('shortid');
const fetch = require('node-fetch');

@@ -11,19 +10,13 @@ const keyBy = require('lodash/keyBy');

let firstTag = tags.shift();
let gtags = tags.map(d => {
let id = shortid.generate();
return `
ga('create', '${d}', 'auto', '${id}');
ga('${id}.send', 'pageview');
`;
});
return `
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '${firstTag}', 'auto');
ga('send', 'pageview');
${gtags.join('')}
`;
const firstTag = tags.shift();
const gtags = tags.map(d => `gtag('config', '${d}');`);
return `<script async src="https://www.googletagmanager.com/gtag/js?id=${firstTag}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${firstTag}');
${gtags.join('')}
</script>`;
}

@@ -30,0 +23,0 @@

{
"name": "@volenday/google-analytics",
"version": "0.1.1",
"version": "0.1.2",
"private": false,

@@ -10,12 +10,10 @@ "license": "MIT",

"peerDependencies": {
"lodash": "~4.17.13",
"node-fetch": "~2.6.0",
"shortid": "~2.2.14"
"lodash": "~4.17.15",
"node-fetch": "~2.6.0"
},
"dependencies": {
"lodash": "~4.17.15",
"node-fetch": "~2.6.0",
"shortid": "~2.2.14"
"node-fetch": "~2.6.0"
},
"devDependencies": {}
}
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