@piwikpro/vue-piwik-pro
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -58,3 +58,4 @@ const DEFAULT_DATA_LAYER_NAME = "dataLayer"; | ||
containerUrl, | ||
dataLayerName: config.dataLayerName | ||
dataLayerName: config.dataLayerName, | ||
nonceValue: config.nonce | ||
}); | ||
@@ -64,4 +65,5 @@ const body = document.getElementsByTagName("body")[0]; | ||
} | ||
function getInitScript({ containerId, containerUrl, dataLayerName: dataLayerName2 }) { | ||
function getInitScript({ containerId, containerUrl, dataLayerName: dataLayerName2, nonceValue }) { | ||
const dataLayer = dataLayerName2 || DEFAULT_DATA_LAYER_NAME; | ||
const nonceTag = nonceValue ? `,tags.nonce="${nonceValue}"` : ""; | ||
return `(function(window, document, dataLayerName, id) { | ||
@@ -71,3 +73,3 @@ window[dataLayerName]=window[dataLayerName]||[],window[dataLayerName].push({start:(new Date).getTime(),event:"stg.start"});var scripts=document.getElementsByTagName('script')[0],tags=document.createElement('script'); | ||
var isStgDebug=(window.location.href.match("stg_debug")||document.cookie.match("stg_debug"))&&!window.location.href.match("stg_disable_debug");stgCreateCookie("stg_debug",isStgDebug?1:"",isStgDebug?14:-1); | ||
var qP=[];dataLayerName!=="dataLayer"&&qP.push("data_layer_name="+dataLayerName),isStgDebug&&qP.push("stg_debug");var qPString=qP.length>0?("?"+qP.join("&")):""; | ||
var qP=[];dataLayerName!=="dataLayer"&&qP.push("data_layer_name="+dataLayerName)${nonceTag},isStgDebug&&qP.push("stg_debug");var qPString=qP.length>0?("?"+qP.join("&")):""; | ||
tags.async=!0,tags.src="${containerUrl}/"+id+".js"+qPString,scripts.parentNode.insertBefore(tags,scripts); | ||
@@ -191,9 +193,3 @@ !function(a,n,i){a[n]=a[n]||{};for(var c=0;c<i.length;c++)!function(i){a[n][i]=a[n][i]||{},a[n][i].api=a[n][i].api||function(){var a=[].slice.call(arguments,0);"string"==typeof a[0]&&window[dataLayerName].push({event:n+"."+i+":"+a[0],parameters:[].slice.call(arguments,1)})}}(i[c])}(window,"ppms",["tm","cm"]); | ||
function trackEvent(category, action, name, value, dimensions) { | ||
const eventArguments = [ | ||
category, | ||
action, | ||
...name ? [name] : [], | ||
...name ? [value] : [], | ||
...dimensions ? [dimensions] : [] | ||
]; | ||
const eventArguments = [category, action, name, value, dimensions]; | ||
push([CUSTOM_EVENT_TRACK_EVENT.CUSTOM_EVENT, ...eventArguments]); | ||
@@ -200,0 +196,0 @@ } |
{ | ||
"name": "@piwikpro/vue-piwik-pro", | ||
"private": false, | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"type": "module", | ||
@@ -42,3 +42,3 @@ "author": "Piwik Pro Integration Team <integrations@piwik.pro>", | ||
"@babel/preset-typescript": "^7.23.3", | ||
"@happy-dom/jest-environment": "^13.3.8", | ||
"@happy-dom/jest-environment": "^15.11.4", | ||
"@rollup/plugin-typescript": "^11.1.6", | ||
@@ -67,3 +67,3 @@ "@types/jest": "^29.5.12", | ||
"vite": "^5.0.8", | ||
"vue-tsc": "^1.8.25" | ||
"vue-tsc": "^2.1.10" | ||
}, | ||
@@ -77,4 +77,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@piwikpro/tracking-base-library": "^1.2.0" | ||
"@piwikpro/tracking-base-library": "^1.2.2" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
148930
1354