keen-tracking
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -9,2 +9,14 @@ <!-- | ||
--> | ||
<a name="1.4.1"></a> | ||
# 1.4.1 Fixes | ||
**NEW:** | ||
* Cookie sharing across subdomains: `client.initAutoTracking({ shareUuidAcrossDomains: true });` (#104 contributed by [jmousseau](https://github.com/jmousseau)) | ||
**FIXED:** | ||
* Gracefully handle a tags without hrefs (#105) | ||
* Avoid refreshing window when `href="#"` (#111) | ||
* Don't attempt to clone a function attribute in deepExtend (#106) | ||
* Record deferred events loop (#116) | ||
<a name="1.4.0"></a> | ||
@@ -11,0 +23,0 @@ # 1.4.0 Improved Protocol Handling and Dev Setup |
@@ -15,3 +15,4 @@ var pkg = require('../package.json'); | ||
recordPageViews: true, | ||
recordScrollState: true | ||
recordScrollState: true, | ||
shareUuidAcrossDomains: false | ||
}, obj); | ||
@@ -25,3 +26,7 @@ | ||
uuid = helpers.getUniqueId(); | ||
cookie.set('uuid', uuid); | ||
var domainName = helpers.getDomainName(window.location.host); | ||
cookie.set('uuid', uuid, | ||
domainName && options.shareUuidAcrossDomains ? { | ||
domain: '.' + domainName | ||
} : {}); | ||
} | ||
@@ -28,0 +33,0 @@ |
@@ -37,2 +37,3 @@ (function(env) { | ||
'getDatetimeIndex' : require('./helpers/getDatetimeIndex'), | ||
'getDomainName' : require('./helpers/getDomainName'), | ||
'getDomNodePath' : require('./helpers/getDomNodePath'), | ||
@@ -39,0 +40,0 @@ 'getDomNodeProfile' : require('./helpers/getDomNodeProfile'), |
@@ -75,2 +75,5 @@ var Keen = require('./index'); | ||
self.queue.config = clonedQueueConfig; | ||
self.queue.on('flush', function(){ | ||
self.recordDeferredEvents(); | ||
}); | ||
self.emit('recordDeferredEvents', clonedQueueEvents); | ||
@@ -77,0 +80,0 @@ self.recordEvents(clonedQueueEvents, function(err, res){ |
@@ -7,3 +7,3 @@ var getDomNodePath = require('./getDomNodePath'); | ||
class: el.className, | ||
href: el.href, | ||
href: el.href || null, | ||
id: el.id, | ||
@@ -10,0 +10,0 @@ method: el.method, |
@@ -16,9 +16,14 @@ module.exports = deepExtend; | ||
for (var prop in arguments[i]){ | ||
// Recurse when both contain objects of same name and incoming is not a null object | ||
if ('undefined' !== typeof target[prop] && 'object' === typeof arguments[i][prop] && arguments[i][prop] !== null) { | ||
deepExtend(target[prop], clone(arguments[i][prop])); | ||
// Recurse when both contain objects of same name | ||
// and incoming is not a null object | ||
if (typeof target[prop] !== 'undefined' | ||
&& typeof arguments[i][prop] === 'object' | ||
&& arguments[i][prop] !== null) { | ||
deepExtend(target[prop], clone(arguments[i][prop])); | ||
} | ||
// Otherwise just copy it over... | ||
else if (arguments[i][prop] !== undefined) { | ||
target[prop] = clone(arguments[i][prop]); | ||
else if ( | ||
arguments[i][prop] !== undefined && | ||
typeof arguments[i][prop] !== 'function') { | ||
target[prop] = clone(arguments[i][prop]); | ||
} | ||
@@ -25,0 +30,0 @@ } |
@@ -211,5 +211,11 @@ var Emitter = require('component-emitter'); | ||
evt.returnValue = false; | ||
setTimeout(function(){ | ||
window.location = anchor.href; | ||
}, timeout); | ||
if ( | ||
anchor.href | ||
&& anchor.href !== '#' | ||
&& anchor.href !== (window.location + '#') | ||
) { | ||
setTimeout(function(){ | ||
window.location = anchor.href; | ||
}, timeout); | ||
} | ||
} | ||
@@ -216,0 +222,0 @@ |
{ | ||
"name": "keen-tracking", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "Data Collection SDK for Keen IO", | ||
@@ -13,6 +13,9 @@ "main": "lib/server.js", | ||
"start": "gulp with-tests", | ||
"test": "gulp test:cli" | ||
"test": "gulp test:cli", | ||
"preversion": "gulp build && npm run test", | ||
"version": "git add .", | ||
"postversion": "git push && git push --tags" | ||
}, | ||
"bugs": "https://github.com/keen/keen-tracking.js/issues", | ||
"author": "Dustin Larimer <dustin@keen.io> (https://keen.io/)", | ||
"author": "Keen IO <team@keen.io> (https://keen.io/)", | ||
"contributors": [ | ||
@@ -22,3 +25,4 @@ "Dustin Larimer <dustin@keen.io> (https://github.com/dustinlarimer)", | ||
"Joe Wegner <joe@keen.io> (http://www.wegnerdesign.com)", | ||
"Alex Kleissner <alex@keen.io> (https://github.com/hex337)" | ||
"Alex Kleissner <alex@keen.io> (https://github.com/hex337)", | ||
"Adam Kasprowicz <adam.kasprowicz@keen.io> (https://github.com/adamkasprowicz)" | ||
], | ||
@@ -32,2 +36,3 @@ "license": "MIT", | ||
"devDependencies": { | ||
"aws-sdk": "^2.229.1", | ||
"browserify": "^9.0.8", | ||
@@ -34,0 +39,0 @@ "chai": "^2.3.0", |
@@ -14,3 +14,3 @@ # keen-tracking.js [![Build Status](https://travis-ci.org/keen/keen-tracking.js.svg?branch=master)](https://travis-ci.org/keen/keen-tracking.js) | ||
```html | ||
<script src="https://d26b395fwzu5fz.cloudfront.net/keen-tracking-1.4.0.min.js"></script> | ||
<script src="https://d26b395fwzu5fz.cloudfront.net/keen-tracking-1.4.1.min.js"></script> | ||
``` | ||
@@ -45,3 +45,3 @@ | ||
### Automated Event Tracking (browser-only) | ||
### Automated Event Tracking (Browser-only) | ||
@@ -67,3 +67,3 @@ Automatically record `pageviews`, `clicks`, and `form_submissions` events with robust data models: | ||
### Pageview Tracking | ||
### Pageview Tracking (Browser/Front-end) | ||
@@ -148,3 +148,3 @@ First, let's create a new `client` instance with your Project ID and Write Key, and use the `.extendEvents()` method to define a solid baseline data model that will be applied to every single event that is recorded. Consistent data models and property names make life much easier later on, when analyzing and managing several event streams. This setup also includes our [data enrichment add-ons](https://keen.io/docs/streams/data-enrichment-overview/), which will populate additional information when an event is received on our end. | ||
client.recordEvent('pageview', {}); | ||
client.recordEvent('pageviews', {}); | ||
``` | ||
@@ -163,7 +163,16 @@ | ||
**Using React? Check out these setup guides:** | ||
**App Frameworks:** | ||
* [React Flux Logger](./docs/examples/react-flux): How to instrument a Flux ReduceStore | ||
* [React Redux Middleware](./docs/examples/react-redux-middleware): How to instrument a Redux Store | ||
* [Vue.js Vuex Store](./docs/examples/vue-vuex): How to instrument a Vue Vuex Store | ||
**Video Players:** | ||
* [Facebook video player](./docs/examples/video/facebook-video) | ||
* [HTML5 video player](./docs/examples/video/html5) | ||
* [Video.js player](./docs/examples/video/video-js) | ||
* [Vimeo video player](./docs/examples/video/vimeo) | ||
* [Youtube iFrame video player](./docs/examples/video/youtube) | ||
[Full documentation is available here](./docs/README.md) | ||
@@ -173,3 +182,3 @@ | ||
### Click and Form Submit Tracking | ||
### Click and Form Submit Tracking (Browser/Front-end) | ||
@@ -222,3 +231,3 @@ Clicks and form submissions can be captured with `.listenTo()`. This function intercepts events for designated elements and creates a brief 500ms delay, allowing an HTTP request to execute before the page begins to unload. | ||
### Block Bots and Improve Device Recognition | ||
### Block Bots and Improve Device Recognition (Browser/Front-end) | ||
@@ -257,2 +266,20 @@ Install [mobile-detect.js](https://github.com/hgoebl/mobile-detect.js) to identify basic device types and block noisy bots and crawlers. | ||
### Server Side Tracking (Back-end) | ||
```javascript | ||
const Keen = require('keen-tracking'); | ||
const client = new Keen({ | ||
projectId: 'PROJECT_ID', | ||
writeKey: 'WRITE_KEY' | ||
}); | ||
client.recordEvent('purchases', { | ||
item: 'Avocado', | ||
price: 12 | ||
}); | ||
``` | ||
--- | ||
### Contributing | ||
@@ -259,0 +286,0 @@ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
80243
34
1886
294
34
3