@mparticle/gatsby-plugin-mparticle
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -0,0 +0,0 @@ "use strict"; |
@@ -14,11 +14,14 @@ "use strict"; | ||
var setHeadComponents = _ref.setHeadComponents; | ||
var key = pluginOptions.apiKey; | ||
var apiKey = pluginOptions.apiKey, | ||
config = pluginOptions.config; | ||
console.log('api? ', apiKey); | ||
console.log('config? ', config); | ||
return setHeadComponents([_react.default.createElement("script", { | ||
key: "gatsby-plugin-mparticle", | ||
dangerouslySetInnerHTML: { | ||
__html: "(function (apiKey) {\n window.mParticle = window.mParticle || {};\n window.mParticle.eCommerce = { Cart: {} };\n \n window.mParticle.Identity = {};\n window.mParticle.config = window.mParticle.config || {\n isDevelopmentMode: true,\n useCookieStorage: true,\n };\n window.mParticle.config.rq = [];\n window.mParticle.ready = function (f) {\n window.mParticle.config.rq.push(f);\n };\n function a(o,t){return function(){t&&(o=t+\".\"+o);var e=Array.prototype.slice.call(arguments);e.unshift(o),window.mParticle.config.rq.push(e)}}var x=[\"endSession\",\"logError\",\"logEvent\",\"logForm\",\"logLink\",\"logPageView\",\"setSessionAttribute\",\"setAppName\",\"setAppVersion\",\"setOptOut\",\"setPosition\",\"startNewSession\",\"startTrackingLocation\",\"stopTrackingLocation\"],y=[\"setCurrencyCode\",\"logCheckout\"],z=[\"login\",\"logout\",\"modify\"];x.forEach(function(o){window.mParticle[o]=a(o)}),y.forEach(function(o){window.mParticle.eCommerce[o]=a(o,\"eCommerce\")}),z.forEach(function(o){window.mParticle.Identity[o]=a(o,\"Identity\")});\n \n var mp = document.createElement('script');\n mp.type = 'text/javascript';\n mp.async = true;\n mp.src = ('https:' == document.location.protocol ? 'https://jssdkcdns' : 'http://jssdkcdn') + '.mparticle.com/js/v2/' + apiKey + '/mparticle.js';\n var s = document.getElementsByTagName('script')[0];\n s.parentNode.insertBefore(mp, s);\n })('" + key + "')" | ||
__html: "(function (apiKey) {\n window.mParticle = window.mParticle || {};\n window.mParticle.eCommerce = { Cart: {} };\n \n window.mParticle.Identity = {};\n window.mParticle.config = window.mParticle.config || " + JSON.stringify(config) + ";\n window.mParticle.config.rq = [];\n window.mParticle.ready = function (f) {\n window.mParticle.config.rq.push(f);\n };\n function a(o,t){return function(){t&&(o=t+\".\"+o);var e=Array.prototype.slice.call(arguments);e.unshift(o),window.mParticle.config.rq.push(e)}}var x=[\"endSession\",\"logError\",\"logEvent\",\"logForm\",\"logLink\",\"logPageView\",\"setSessionAttribute\",\"setAppName\",\"setAppVersion\",\"setOptOut\",\"setPosition\",\"startNewSession\",\"startTrackingLocation\",\"stopTrackingLocation\"],y=[\"setCurrencyCode\",\"logCheckout\"],z=[\"login\",\"logout\",\"modify\"];x.forEach(function(o){window.mParticle[o]=a(o)}),y.forEach(function(o){window.mParticle.eCommerce[o]=a(o,\"eCommerce\")}),z.forEach(function(o){window.mParticle.Identity[o]=a(o,\"Identity\")});\n \n var mp = document.createElement('script');\n mp.type = 'text/javascript';\n mp.async = true;\n mp.src = ('https:' == document.location.protocol ? 'https://jssdkcdns' : 'http://jssdkcdn') + '.mparticle.com/js/v2/' + apiKey + '/mparticle.js';\n var s = document.getElementsByTagName('script')[0];\n s.parentNode.insertBefore(mp, s);\n })('" + apiKey + "')" | ||
}, | ||
__source: { | ||
fileName: _jsxFileName, | ||
lineNumber: 8 | ||
lineNumber: 10 | ||
}, | ||
@@ -25,0 +28,0 @@ __self: this |
// noop | ||
"use strict"; |
{ | ||
"name": "@mparticle/gatsby-plugin-mparticle", | ||
"description": "Gatsby plugin to add mParticle to a site", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"main": "gatsby-ssr.js", | ||
@@ -6,0 +6,0 @@ "author": "Danny Hendrix <dhendrix@mparticle.com>", |
@@ -18,2 +18,5 @@ # gatsby-plugin-mparticle | ||
logPageViews: true or false, | ||
config: { | ||
'Your mParticle config object here, if needed e.g. isDevelopmentMode', | ||
}, | ||
} | ||
@@ -20,0 +23,0 @@ } |
@@ -6,3 +6,5 @@ import React from "react" | ||
) => { | ||
const key = pluginOptions.apiKey; | ||
const { apiKey, config } = pluginOptions; | ||
console.log('api? ', apiKey) | ||
console.log('config? ', config) | ||
return setHeadComponents([ | ||
@@ -17,6 +19,3 @@ <script | ||
window.mParticle.Identity = {}; | ||
window.mParticle.config = window.mParticle.config || { | ||
isDevelopmentMode: true, | ||
useCookieStorage: true, | ||
}; | ||
window.mParticle.config = window.mParticle.config || ${JSON.stringify(config)}; | ||
window.mParticle.config.rq = []; | ||
@@ -34,3 +33,3 @@ window.mParticle.ready = function (f) { | ||
s.parentNode.insertBefore(mp, s); | ||
})('${key}')`, | ||
})('${apiKey}')`, | ||
}} | ||
@@ -37,0 +36,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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
7651
76
26