keen-tracking
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -9,3 +9,13 @@ <!-- | ||
--> | ||
<a name="1.4.0"></a> | ||
# 1.4.0 Improved Protocol Handling and Dev Setup | ||
**NEW:** | ||
* Server-side tracking now respects the `"http"` value for `protocol` option, using the `http` module. Previously this always used `https`, regardless of the configuration value, which can cause issues for internal proxies (#82, via #92 contributed by [lukechilds](https://github.com/lukechilds)) | ||
* Auto-tracking now records `page.time_on_page` (seconds) for all events | ||
**FIXED:** | ||
* This project now builds and runs correctly in NodeJS v7 and v8 (#95, via #96 contributed by [lukechilds](https://github.com/lukechilds)) | ||
<a name="1.3.0"></a> | ||
@@ -12,0 +22,0 @@ # 1.3.0 Automated Event Tracking (browser-only) |
@@ -18,2 +18,4 @@ var pkg = require('../package.json'); | ||
var now = new Date(); | ||
var cookie = new utils.cookie('keen'); | ||
@@ -44,3 +46,4 @@ var uuid = cookie.get('uuid'); | ||
title: document ? document.title : null, | ||
description: browserProfile.description | ||
description: browserProfile.description, | ||
time_on_page: getSecondsSinceDate(now) | ||
}, | ||
@@ -122,2 +125,4 @@ | ||
if (options.recordClicks === true) { | ||
@@ -168,2 +173,7 @@ utils.listener('a, a *').on('click', function(e) { | ||
function getSecondsSinceDate(date) { | ||
var diff = new Date().getTime() - date.getTime(); | ||
return Math.round(diff / 1000); | ||
} | ||
module.exports = initAutoTracking; |
@@ -5,2 +5,3 @@ var Keen = require('./index'); | ||
var extendEvents = require('./extend-events'); | ||
var http = require('http'); | ||
var https = require('https'); | ||
@@ -201,3 +202,4 @@ | ||
}; | ||
var req = https.request(options, function(response) { | ||
var protocol = (this.config.protocol === 'http') ? http : https; | ||
var req = protocol.request(options, function(response) { | ||
var body = ''; | ||
@@ -204,0 +206,0 @@ response.on('data', function(d) { |
{ | ||
"name": "keen-tracking", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Data Collection SDK for Keen IO", | ||
@@ -48,3 +48,3 @@ "main": "lib/server.js", | ||
"gulp-yuicompressor": "0.0.3", | ||
"karma": "^0.12.32", | ||
"karma": "^1.7.1", | ||
"karma-chrome-launcher": "^0.1.12", | ||
@@ -51,0 +51,0 @@ "karma-firefox-launcher": "^0.1.6", |
@@ -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.3.0.min.js"></script> | ||
<script src="https://d26b395fwzu5fz.cloudfront.net/keen-tracking-1.4.0.min.js"></script> | ||
``` | ||
@@ -50,3 +50,3 @@ | ||
```html | ||
<script src="https://d26b395fwzu5fz.cloudfront.net/keen-tracking-1.3.0.min.js"></script> | ||
<script src="https://d26b395fwzu5fz.cloudfront.net/keen-tracking-1.4.0.min.js"></script> | ||
<script> | ||
@@ -53,0 +53,0 @@ Keen.ready(function(){ |
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
Network access
Supply chain riskThis module accesses the network.
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
78156
1861
2