@snowplow/browser-plugin-ad-tracking
Advanced tools
Comparing version 3.3.1 to 3.4.0
/*! | ||
* Ad tracking for Snowplow v3.3.1 (http://bit.ly/sp-js) | ||
* Ad tracking for Snowplow v3.4.0 (http://bit.ly/sp-js) | ||
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang | ||
@@ -4,0 +4,0 @@ * Licensed under BSD-3-Clause |
/*! | ||
* Ad tracking for Snowplow v3.3.1 (http://bit.ly/sp-js) | ||
* Ad tracking for Snowplow v3.4.0 (http://bit.ly/sp-js) | ||
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang | ||
@@ -11,3 +11,3 @@ * Licensed under BSD-3-Clause | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.snowplowAdTracking = {})); | ||
}(this, (function (exports) { 'use strict'; | ||
})(this, (function (exports) { 'use strict'; | ||
@@ -36,7 +36,7 @@ /*! ***************************************************************************** | ||
} | ||
return to.concat(ar || from); | ||
return to.concat(ar || Array.prototype.slice.call(from)); | ||
} | ||
/*! | ||
* Core functionality for Snowplow JavaScript trackers v3.3.1 (http://bit.ly/sp-js) | ||
* Core functionality for Snowplow JavaScript trackers v3.4.0 (http://bit.ly/sp-js) | ||
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang | ||
@@ -198,6 +198,6 @@ * Licensed under BSD-3-Clause | ||
if (error) { | ||
console.error.apply(console, __spreadArray([logMsg + '\n', error], extraParams)); | ||
console.error.apply(console, __spreadArray([logMsg + '\n', error], extraParams, false)); | ||
} | ||
else { | ||
console.error.apply(console, __spreadArray([logMsg], extraParams)); | ||
console.error.apply(console, __spreadArray([logMsg], extraParams, false)); | ||
} | ||
@@ -217,6 +217,6 @@ } | ||
if (error) { | ||
console.warn.apply(console, __spreadArray([logMsg + '\n', error], extraParams)); | ||
console.warn.apply(console, __spreadArray([logMsg + '\n', error], extraParams, false)); | ||
} | ||
else { | ||
console.warn.apply(console, __spreadArray([logMsg], extraParams)); | ||
console.warn.apply(console, __spreadArray([logMsg], extraParams, false)); | ||
} | ||
@@ -234,3 +234,3 @@ } | ||
if (logLevel >= LOG_LEVEL.debug && typeof console !== 'undefined') { | ||
console.debug.apply(console, __spreadArray([label + message], extraParams)); | ||
console.debug.apply(console, __spreadArray([label + message], extraParams, false)); | ||
} | ||
@@ -247,3 +247,3 @@ } | ||
if (logLevel >= LOG_LEVEL.info && typeof console !== 'undefined') { | ||
console.info.apply(console, __spreadArray([label + message], extraParams)); | ||
console.info.apply(console, __spreadArray([label + message], extraParams, false)); | ||
} | ||
@@ -373,3 +373,3 @@ } | ||
/*! | ||
* Core functionality for Snowplow Browser trackers v3.3.1 (http://bit.ly/sp-js) | ||
* Core functionality for Snowplow Browser trackers v3.4.0 (http://bit.ly/sp-js) | ||
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang | ||
@@ -491,3 +491,3 @@ * Licensed under BSD-3-Clause | ||
}))); | ||
})); | ||
//# sourceMappingURL=index.umd.js.map |
/*! | ||
* Ad tracking for Snowplow v3.3.1 (http://bit.ly/sp-js) | ||
* Ad tracking for Snowplow v3.4.0 (http://bit.ly/sp-js) | ||
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang | ||
@@ -7,3 +7,3 @@ * Licensed under BSD-3-Clause | ||
"use strict";!function(n,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o((n="undefined"!=typeof globalThis?globalThis:n||self).snowplowAdTracking={})}(this,(function(n){function o(n,o,e){if(e||2===arguments.length)for(var t,r=0,c=o.length;r<c;r++)!t&&r in o||(t||(t=Array.prototype.slice.call(o,0,r)),t[r]=o[r]);return n.concat(t||o)}function e(n){var o=n.event;n=o.schema;var e=o.data;return o=function(){var n,o={},e=[],t=[],r=function(n,e){null!=e&&""!==e&&(o[n]=e)};return{add:r,addDict:function(n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&r(o,n[o])},addJson:function(n,o,r){var c;if(c=r)n:{if(null!=r&&(r.constructor==={}.constructor||r.constructor===[].constructor))for(var a in r)if(Object.prototype.hasOwnProperty.call(r,a)){c=!0;break n}c=!1}c&&(n={keyIfEncoded:n,keyIfNotEncoded:o,json:r},t.push(n),e.push(n))},getPayload:function(){return o},getJson:function(){return e},withJsonProcessor:function(o){n=o},build:function(){return null==n||n(this,t),o}}}(),n={schema:"iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0",data:{schema:n,data:e}},o.add("e","ue"),o.addJson("ue_px","ue_pr",n),o}function t(n,o){void 0===o&&(o={});var e,t={};for(e in n)(o[e]||null!==n[e]&&void 0!==n[e])&&(t[e]=n[e]);return t}function r(n,o,e){try{var t=null!=n?n:Object.keys(o);n=[];for(var r=0;r<t.length;r++){var c=t[r];o.hasOwnProperty(c)?n.push(o[c]):i.warn(c+" not configured")}n.forEach(e)}catch(n){i.error("Function failed",n)}}var c,a;(a=c||(c={}))[a.none=0]="none",a[a.error=1]="error",a[a.warn=2]="warn",a[a.debug=3]="debug",a[a.info=4]="info";var i=function(n){return void 0===n&&(n=c.warn),{setLogLevel:function(o){n=c[o]?o:c.warn},warn:function(e,t){for(var r=[],a=2;a<arguments.length;a++)r[a-2]=arguments[a];n>=c.warn&&"undefined"!=typeof console&&(a="Snowplow: "+e,t?console.warn.apply(console,o([a+"\n",t],r)):console.warn.apply(console,o([a],r)))},error:function(e,t){for(var r=[],a=2;a<arguments.length;a++)r[a-2]=arguments[a];n>=c.error&&"undefined"!=typeof console&&(a="Snowplow: "+e+"\n",t?console.error.apply(console,o([a+"\n",t],r)):console.error.apply(console,o([a],r)))},debug:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];n>=c.debug&&"undefined"!=typeof console&&console.debug.apply(console,o(["Snowplow: "+e],t))},info:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];n>=c.info&&"undefined"!=typeof console&&console.info.apply(console,o(["Snowplow: "+e],t))}}}(),s={};n.AdTrackingPlugin=function(){return{activateBrowserPlugin:function(n){s[n.id]=n}}},n.trackAdClick=function(n,o){void 0===o&&(o=Object.keys(s)),r(o,s,(function(o){var r=(o=o.core).track,c={schema:"iglu:com.snowplowanalytics.snowplow/ad_click/jsonschema/1-0-0",data:t({targetUrl:n.targetUrl,clickId:n.clickId,costModel:n.costModel,cost:n.cost,bannerId:n.bannerId,zoneId:n.zoneId,impressionId:n.impressionId,advertiserId:n.advertiserId,campaignId:n.campaignId})};c=e({event:c}),r.call(o,c,n.context,n.timestamp)}))},n.trackAdConversion=function(n,o){void 0===o&&(o=Object.keys(s)),r(o,s,(function(o){var r=(o=o.core).track,c={schema:"iglu:com.snowplowanalytics.snowplow/ad_conversion/jsonschema/1-0-0",data:t({conversionId:n.conversionId,costModel:n.costModel,cost:n.cost,category:n.category,action:n.action,property:n.property,initialValue:n.initialValue,advertiserId:n.advertiserId,campaignId:n.campaignId})};c=e({event:c}),r.call(o,c,n.context,n.timestamp)}))},n.trackAdImpression=function(n,o){void 0===o&&(o=Object.keys(s)),r(o,s,(function(o){var r=(o=o.core).track,c={schema:"iglu:com.snowplowanalytics.snowplow/ad_impression/jsonschema/1-0-0",data:t({impressionId:n.impressionId,costModel:n.costModel,cost:n.cost,targetUrl:n.targetUrl,bannerId:n.bannerId,zoneId:n.zoneId,advertiserId:n.advertiserId,campaignId:n.campaignId})};c=e({event:c}),r.call(o,c,n.context,n.timestamp)}))},Object.defineProperty(n,"__esModule",{value:!0})})); | ||
"use strict";!function(o,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((o="undefined"!=typeof globalThis?globalThis:o||self).snowplowAdTracking={})}(this,(function(o){function n(o,n,e){if(e||2===arguments.length)for(var t,r=0,c=n.length;r<c;r++)!t&&r in n||(t||(t=Array.prototype.slice.call(n,0,r)),t[r]=n[r]);return o.concat(t||Array.prototype.slice.call(n))}function e(o){var n=o.event;o=n.schema;var e=n.data;return n=function(){var o,n={},e=[],t=[],r=function(o,e){null!=e&&""!==e&&(n[o]=e)};return{add:r,addDict:function(o){for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&r(n,o[n])},addJson:function(o,n,r){var c;if(c=r)o:{if(null!=r&&(r.constructor==={}.constructor||r.constructor===[].constructor))for(var a in r)if(Object.prototype.hasOwnProperty.call(r,a)){c=!0;break o}c=!1}c&&(o={keyIfEncoded:o,keyIfNotEncoded:n,json:r},t.push(o),e.push(o))},getPayload:function(){return n},getJson:function(){return e},withJsonProcessor:function(n){o=n},build:function(){return null==o||o(this,t),n}}}(),o={schema:"iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0",data:{schema:o,data:e}},n.add("e","ue"),n.addJson("ue_px","ue_pr",o),n}function t(o,n){void 0===n&&(n={});var e,t={};for(e in o)(n[e]||null!==o[e]&&void 0!==o[e])&&(t[e]=o[e]);return t}function r(o,n,e){try{var t=null!=o?o:Object.keys(n);o=[];for(var r=0;r<t.length;r++){var c=t[r];n.hasOwnProperty(c)?o.push(n[c]):i.warn(c+" not configured")}o.forEach(e)}catch(o){i.error("Function failed",o)}}var c,a;(a=c||(c={}))[a.none=0]="none",a[a.error=1]="error",a[a.warn=2]="warn",a[a.debug=3]="debug",a[a.info=4]="info";var i=function(o){return void 0===o&&(o=c.warn),{setLogLevel:function(n){o=c[n]?n:c.warn},warn:function(e,t){for(var r=[],a=2;a<arguments.length;a++)r[a-2]=arguments[a];o>=c.warn&&"undefined"!=typeof console&&(a="Snowplow: "+e,t?console.warn.apply(console,n([a+"\n",t],r,!1)):console.warn.apply(console,n([a],r,!1)))},error:function(e,t){for(var r=[],a=2;a<arguments.length;a++)r[a-2]=arguments[a];o>=c.error&&"undefined"!=typeof console&&(a="Snowplow: "+e+"\n",t?console.error.apply(console,n([a+"\n",t],r,!1)):console.error.apply(console,n([a],r,!1)))},debug:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];o>=c.debug&&"undefined"!=typeof console&&console.debug.apply(console,n(["Snowplow: "+e],t,!1))},info:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];o>=c.info&&"undefined"!=typeof console&&console.info.apply(console,n(["Snowplow: "+e],t,!1))}}}(),s={};o.AdTrackingPlugin=function(){return{activateBrowserPlugin:function(o){s[o.id]=o}}},o.trackAdClick=function(o,n){void 0===n&&(n=Object.keys(s)),r(n,s,(function(n){var r=(n=n.core).track,c={schema:"iglu:com.snowplowanalytics.snowplow/ad_click/jsonschema/1-0-0",data:t({targetUrl:o.targetUrl,clickId:o.clickId,costModel:o.costModel,cost:o.cost,bannerId:o.bannerId,zoneId:o.zoneId,impressionId:o.impressionId,advertiserId:o.advertiserId,campaignId:o.campaignId})};c=e({event:c}),r.call(n,c,o.context,o.timestamp)}))},o.trackAdConversion=function(o,n){void 0===n&&(n=Object.keys(s)),r(n,s,(function(n){var r=(n=n.core).track,c={schema:"iglu:com.snowplowanalytics.snowplow/ad_conversion/jsonschema/1-0-0",data:t({conversionId:o.conversionId,costModel:o.costModel,cost:o.cost,category:o.category,action:o.action,property:o.property,initialValue:o.initialValue,advertiserId:o.advertiserId,campaignId:o.campaignId})};c=e({event:c}),r.call(n,c,o.context,o.timestamp)}))},o.trackAdImpression=function(o,n){void 0===n&&(n=Object.keys(s)),r(n,s,(function(n){var r=(n=n.core).track,c={schema:"iglu:com.snowplowanalytics.snowplow/ad_impression/jsonschema/1-0-0",data:t({impressionId:o.impressionId,costModel:o.costModel,cost:o.cost,targetUrl:o.targetUrl,bannerId:o.bannerId,zoneId:o.zoneId,advertiserId:o.advertiserId,campaignId:o.campaignId})};c=e({event:c}),r.call(n,c,o.context,o.timestamp)}))},Object.defineProperty(o,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.umd.min.js.map |
{ | ||
"name": "@snowplow/browser-plugin-ad-tracking", | ||
"version": "3.3.1", | ||
"version": "3.4.0", | ||
"description": "Ad tracking for Snowplow", | ||
@@ -21,33 +21,37 @@ "homepage": "http://bit.ly/sp-js", | ||
"dependencies": { | ||
"@snowplow/browser-tracker-core": "3.3.1", | ||
"@snowplow/tracker-core": "3.3.1", | ||
"tslib": "^2.3.0" | ||
"@snowplow/browser-tracker-core": "3.4.0", | ||
"@snowplow/tracker-core": "3.4.0", | ||
"tslib": "^2.3.1" | ||
}, | ||
"devDependencies": { | ||
"@ampproject/rollup-plugin-closure-compiler": "^0.27.0", | ||
"@rollup/plugin-commonjs": "^17.1.0", | ||
"@rollup/plugin-node-resolve": "^11.2.0", | ||
"@types/jest": "^26.0.20", | ||
"@types/lodash": "^4.14.168", | ||
"@typescript-eslint/eslint-plugin": "^4.9.0", | ||
"@typescript-eslint/parser": "^4.9.0", | ||
"rollup-plugin-ts": "^1.4.0", | ||
"eslint": "^7.7.0", | ||
"jest": "^26.6.3", | ||
"jest-standard-reporter": "^2.0.0", | ||
"lodash": "^4.17.21", | ||
"rollup": "^2.41.1", | ||
"rollup-plugin-cleanup": "^3.2.1", | ||
"rollup-plugin-license": "^2.2.0", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"ts-jest": "^26.5.0", | ||
"typescript": "^4.3.5" | ||
"@ampproject/rollup-plugin-closure-compiler": "~0.27.0", | ||
"@rollup/plugin-commonjs": "~21.0.2", | ||
"@rollup/plugin-node-resolve": "~13.1.3", | ||
"@types/jest": "~27.4.1", | ||
"@types/jsdom": "~16.2.14", | ||
"@types/lodash": "~4.14.180", | ||
"@typescript-eslint/eslint-plugin": "~5.15.0", | ||
"@typescript-eslint/parser": "~5.15.0", | ||
"eslint": "~8.11.0", | ||
"jest": "~27.5.1", | ||
"jest-environment-jsdom": "~27.5.1", | ||
"jest-environment-jsdom-global": "~3.0.0", | ||
"jest-standard-reporter": "~2.0.0", | ||
"lodash": "~4.17.21", | ||
"rollup": "~2.70.1", | ||
"rollup-plugin-cleanup": "~3.2.1", | ||
"rollup-plugin-license": "~2.6.1", | ||
"rollup-plugin-terser": "~7.0.2", | ||
"rollup-plugin-ts": "~2.0.5", | ||
"ts-jest": "~27.1.3", | ||
"typescript": "~4.6.2" | ||
}, | ||
"peerDependencies": { | ||
"@snowplow/browser-tracker": "~3.3.1" | ||
"@snowplow/browser-tracker": "~3.4.0" | ||
}, | ||
"scripts": { | ||
"build": "rollup -c --silent --failAfterWarnings", | ||
"test": "jest --no-cache" | ||
} | ||
"test": "jest" | ||
}, | ||
"readme": "# Snowplow Advertising Tracking\n\n[![npm version][npm-image]][npm-url]\n[![License][license-image]](LICENSE)\n\nBrowser Plugin to be used with `@snowplow/browser-tracker`.\n\nAdds advertising based events to your Snowplow tracking.\n\n## Maintainer quick start\n\nPart of the Snowplow JavaScript Tracker monorepo. \nBuild with [Node.js](https://nodejs.org/en/) (12 LTS or 14 LTS) and [Rush](https://rushjs.io/).\n\n### Setup repository\n\n```bash\nnpm install -g @microsoft/rush \ngit clone https://github.com/snowplow/snowplow-javascript-tracker.git\nrush update\n```\n\n## Package Installation\n\nWith npm:\n\n```bash\nnpm install @snowplow/browser-plugin-ad-tracking\n```\n\n## Usage\n\nInitialize your tracker with the AdTrackingPlugin:\n\n```js\nimport { newTracker } from '@snowplow/browser-tracker';\nimport { AdTrackingPlugin } from '@snowplow/browser-plugin-ad-tracking';\n\nnewTracker('sp1', '{{collector}}', { plugins: [ AdTrackingPlugin() ] }); // Also stores reference at module level\n```\n\nThen use the `trackX` functions from this package to track to all trackers which have been initialized with this plugin:\n\n```js\nimport { trackAdClick } from '@snowplow/browser-plugin-ad-tracking';\n\ntrackAdClick({\n targetUrl: 'http://www.example.com',\n clickId: '12243253',\n costModel: 'cpm',\n cost: 2.5,\n bannerId: '23',\n zoneId: '7',\n impressionId: '67965967893',\n advertiserId: '201',\n campaignId: '12',\n});\n```\n\n## Copyright and license\n\nLicensed and distributed under the [BSD 3-Clause License](LICENSE) ([An OSI Approved License][osi]).\n\nCopyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang.\n\nAll rights reserved.\n\n[npm-url]: https://www.npmjs.com/package/@snowplow/browser-plugin-ad-tracking\n[npm-image]: https://img.shields.io/npm/v/@snowplow/browser-plugin-ad-tracking\n[docs]: https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/javascript-tracker/\n[osi]: https://opensource.org/licenses/BSD-3-Clause\n[license-image]: https://img.shields.io/npm/l/@snowplow/browser-plugin-ad-tracking\n" | ||
} |
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
515852
21
+ Added@snowplow/browser-tracker@3.4.0(transitive)
+ Added@snowplow/browser-tracker-core@3.4.0(transitive)
+ Added@snowplow/tracker-core@3.4.0(transitive)
- Removed@snowplow/browser-tracker@3.3.1(transitive)
- Removed@snowplow/browser-tracker-core@3.3.1(transitive)
- Removed@snowplow/tracker-core@3.3.1(transitive)
Updated@snowplow/tracker-core@3.4.0
Updatedtslib@^2.3.1