@segment/snippet
Advanced tools
Comparing version 4.11.0 to 4.12.0
module.exports=function(settings) { | ||
var __t, __p = ''; | ||
__p += '(function(){\n\n // Create a queue, but don\'t obliterate an existing one!\n var analytics = window.analytics = window.analytics || [];\n\n // If the real analytics.js is already on the page return.\n if (analytics.initialize) return;\n\n // If the snippet was invoked already show an error.\n if (analytics.invoked) {\n if (window.console && console.error) {\n console.error(\'Segment snippet included twice.\');\n }\n return;\n }\n\n // Invoked flag, to make sure the snippet\n // is never invoked twice.\n analytics.invoked = true;\n\n // A list of the methods in Analytics.js to stub.\n analytics.methods = [\n \'trackSubmit\',\n \'trackClick\',\n \'trackLink\',\n \'trackForm\',\n \'pageview\',\n \'identify\',\n \'reset\',\n \'group\',\n \'track\',\n \'ready\',\n \'alias\',\n \'debug\',\n \'page\',\n \'once\',\n \'off\',\n \'on\',\n \'addSourceMiddleware\',\n \'addIntegrationMiddleware\',\n \'setAnonymousId\'\n ];\n\n // Define a factory to create stubs. These are placeholders\n // for methods in Analytics.js so that you never have to wait\n // for it to load to actually record data. The `method` is\n // stored as the first argument, so we can replay the data.\n analytics.factory = function(method){\n return function(){\n var args = Array.prototype.slice.call(arguments);\n args.unshift(method);\n analytics.push(args);\n return analytics;\n };\n };\n\n // For each of our methods, generate a queueing stub.\n for (var i = 0; i < analytics.methods.length; i++) {\n var key = analytics.methods[i];\n analytics[key] = analytics.factory(key);\n }\n\n // Define a method to load Analytics.js from our CDN,\n // and that will be sure to only ever load it once.\n analytics.load = function(key, options){\n // Create an async script element based on your key.\n var script = document.createElement(\'script\');\n script.type = \'text/javascript\';\n script.async = true;\n script.src = \'https://' + | ||
__p += '(function(){\n\n // Create a queue, but don\'t obliterate an existing one!\n var analytics = window.analytics = window.analytics || [];\n\n // If the real analytics.js is already on the page return.\n if (analytics.initialize) return;\n\n // If the snippet was invoked already show an error.\n if (analytics.invoked) {\n if (window.console && console.error) {\n console.error(\'Segment snippet included twice.\');\n }\n return;\n }\n\n // Invoked flag, to make sure the snippet\n // is never invoked twice.\n analytics.invoked = true;\n\n // A list of the methods in Analytics.js to stub.\n analytics.methods = [\n \'trackSubmit\',\n \'trackClick\',\n \'trackLink\',\n \'trackForm\',\n \'pageview\',\n \'identify\',\n \'reset\',\n \'group\',\n \'track\',\n \'ready\',\n \'alias\',\n \'debug\',\n \'page\',\n \'once\',\n \'off\',\n \'on\',\n \'addSourceMiddleware\',\n \'addIntegrationMiddleware\',\n \'setAnonymousId\',\n \'addDestinationMiddleware\'\n ];\n\n // Define a factory to create stubs. These are placeholders\n // for methods in Analytics.js so that you never have to wait\n // for it to load to actually record data. The `method` is\n // stored as the first argument, so we can replay the data.\n analytics.factory = function(method){\n return function(){\n var args = Array.prototype.slice.call(arguments);\n args.unshift(method);\n analytics.push(args);\n return analytics;\n };\n };\n\n // For each of our methods, generate a queueing stub.\n for (var i = 0; i < analytics.methods.length; i++) {\n var key = analytics.methods[i];\n analytics[key] = analytics.factory(key);\n }\n\n // Define a method to load Analytics.js from our CDN,\n // and that will be sure to only ever load it once.\n analytics.load = function(key, options){\n // Create an async script element based on your key.\n var script = document.createElement(\'script\');\n script.type = \'text/javascript\';\n script.async = true;\n script.src = \'https://' + | ||
((__t = ( settings.host )) == null ? '' : __t) + | ||
@@ -5,0 +5,0 @@ '/analytics.js/v1/\'\n + key + \'/analytics.min.js\';\n\n // Insert our script next to the first script element.\n var first = document.getElementsByTagName(\'script\')[0];\n first.parentNode.insertBefore(script, first);\n analytics._loadOptions = options;\n };\n\n // Add a version to keep track of what\'s in the wild.\n analytics.SNIPPET_VERSION = \'4.1.0\';\n\n // Load Analytics.js with your key, which will automatically\n // load the tools you\'ve enabled for your account. Boosh!\n ' + |
module.exports=function(settings) { | ||
var __t, __p = ''; | ||
__p += '!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId"];analytics.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);analytics.push(t);return analytics}};for(var e=0;e<analytics.methods.length;e++){var t=analytics.methods[e];analytics[t]=analytics.factory(t)}analytics.load=function(e,t){var n=document.createElement("script");n.type="text/javascript";n.async=!0;n.src="https://' + | ||
__p += '!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"];analytics.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);analytics.push(t);return analytics}};for(var e=0;e<analytics.methods.length;e++){var t=analytics.methods[e];analytics[t]=analytics.factory(t)}analytics.load=function(e,t){var n=document.createElement("script");n.type="text/javascript";n.async=!0;n.src="https://' + | ||
((__t = ( settings.host )) == null ? '' : __t) + | ||
@@ -5,0 +5,0 @@ '/analytics.js/v1/"+e+"/analytics.min.js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(n,a);analytics._loadOptions=t};analytics.SNIPPET_VERSION="4.1.0";\n' + |
@@ -0,1 +1,7 @@ | ||
4.12.0 / 2020-05-21 | ||
================== | ||
* add destination mw to snippe | ||
4.11.0 / 2020-05-14 | ||
@@ -2,0 +8,0 @@ ================== |
{ | ||
"name": "@segment/snippet", | ||
"author": "Segment.io <friends@segment.com>", | ||
"version": "4.11.0", | ||
"version": "4.12.0", | ||
"repository": "git://github.com/segmentio/snippet.git", | ||
@@ -6,0 +6,0 @@ "description": "Templating methods for rendering the analytics.js snippet.", |
@@ -41,3 +41,4 @@ (function(){ | ||
'addIntegrationMiddleware', | ||
'setAnonymousId' | ||
'setAnonymousId', | ||
'addDestinationMiddleware' | ||
]; | ||
@@ -44,0 +45,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22595
326