From 81f84b425afff3035c313bc3d6ec735ec11eaf80 Mon Sep 17 00:00:00 2001 From: Chris Duell Date: Thu, 9 Mar 2017 10:32:21 +1100 Subject: [PATCH 01/14] Added support for using plan as group --- lib/index.js | 1 + test/index.test.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 624feb5..ef63dfd 100644 --- a/lib/index.js +++ b/lib/index.js @@ -65,6 +65,7 @@ Elevio.prototype.identify = function(identify) { if (email) user.email = email; if (name) user.name = name; if (plan) user.plan = [plan]; + if (plan) user.groups = [plan]; if (objectKeys(traits).length > 0) user.traits = traits; window._elev.user = user; }; diff --git a/test/index.test.js b/test/index.test.js index 659c474..8fc45c0 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -100,10 +100,11 @@ describe('Elevio', function() { analytics.assert(window._elev.user.name === 'Test Person'); }); - it('should send their plan', function() { + it('should send their plan as plan and group', function() { analytics.identify('id', { plan: 'gold' }); analytics.assert(window._elev.user.plan instanceof Array); analytics.assert(window._elev.user.plan[0] === 'gold'); + analytics.assert(window._elev.user.groups[0] === 'gold'); }); it('should send traits when custrom keys are provided', function() { From 519757bf9e3c20301848b2ddd5c14dd207503e4d Mon Sep 17 00:00:00 2001 From: Chris Duell Date: Wed, 22 Mar 2017 09:12:27 +1100 Subject: [PATCH 02/14] Release 2.1.0 --- HISTORY.md | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 8a22fc6..a75b791 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,8 @@ +2.1.0 / 2017-03-22 +================== + + * Added user.plan information from segment as user.groups for elevio usage (to be used for article access control) + 2.0.0 / 2016-06-21 ================== diff --git a/package.json b/package.json index ee43f27..4e310ff 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@segment/analytics.js-integration-elevio", "description": "The Elevio analytics.js integration.", - "version": "2.0.0", + "version": "2.1.0", "keywords": [ "analytics.js", "analytics.js-integration", From 4b83bf5a29ac4bbdb1a2a08d359d0b4fdc1148e0 Mon Sep 17 00:00:00 2001 From: Chris Duell Date: Thu, 17 Aug 2017 09:39:50 +1000 Subject: [PATCH 03/14] Added support for using new setUser method This helps to future proof for companies using the latest version of the embeddable --- lib/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/index.js b/lib/index.js index ef63dfd..6cc3b08 100644 --- a/lib/index.js +++ b/lib/index.js @@ -68,4 +68,7 @@ Elevio.prototype.identify = function(identify) { if (plan) user.groups = [plan]; if (objectKeys(traits).length > 0) user.traits = traits; window._elev.user = user; + if (typeof window._elev.setUser !== "undefined") { + window._elev.setUser(user); + } }; From dfaca762ad960a785c99cdcfada593f177c6b311 Mon Sep 17 00:00:00 2001 From: Chris Duell Date: Thu, 17 Aug 2017 09:41:35 +1000 Subject: [PATCH 04/14] Updated version to 2.2.0 --- HISTORY.md | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index a75b791..908be9e 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,8 @@ +2.2.0 / 2017-08-17 +================== + + * Added better support for comapnies using elevio V4 and logging users into the embeddable via the new setUser method + 2.1.0 / 2017-03-22 ================== diff --git a/package.json b/package.json index 4e310ff..e28023f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@segment/analytics.js-integration-elevio", "description": "The Elevio analytics.js integration.", - "version": "2.1.0", + "version": "2.2.0", "keywords": [ "analytics.js", "analytics.js-integration", From afe4267a6f7f9a7510ac1b43b4d5f3a372fd0bcb Mon Sep 17 00:00:00 2001 From: Chris Duell Date: Thu, 17 Aug 2017 09:50:07 +1000 Subject: [PATCH 05/14] Re-instating package.json updates that a merge missed --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e28023f..e01792b 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ }, "devDependencies": { "@segment/analytics.js-core": "^3.0.0", - "@segment/analytics.js-integration-tester": "^2.0.0", + "@segment/analytics.js-integration-tester": "^3.1.0", "@segment/clear-env": "^2.0.0", "@segment/eslint-config": "^3.1.1", "browserify": "^13.0.0", @@ -40,12 +40,12 @@ "eslint-plugin-mocha": "^2.2.0", "eslint-plugin-require-path-exists": "^1.1.5", "istanbul": "^0.4.3", - "karma": "^1.1.0", + "karma": "1.3.0", "karma-browserify": "^5.0.4", "karma-chrome-launcher": "^1.0.1", "karma-coverage": "^1.0.0", "karma-junit-reporter": "^1.0.0", - "karma-mocha": "^1.0.1", + "karma-mocha": "1.0.1", "karma-phantomjs-launcher": "^1.0.0", "karma-sauce-launcher": "^1.0.0", "karma-spec-reporter": "0.0.26", From 45a65e2ca9abbcad79a9f344540d0c131685fd22 Mon Sep 17 00:00:00 2001 From: Chris Duell Date: Thu, 17 Aug 2017 09:57:02 +1000 Subject: [PATCH 06/14] Linting issue Had double quotes instead of single. Sorry. --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 6cc3b08..420e98f 100644 --- a/lib/index.js +++ b/lib/index.js @@ -68,7 +68,7 @@ Elevio.prototype.identify = function(identify) { if (plan) user.groups = [plan]; if (objectKeys(traits).length > 0) user.traits = traits; window._elev.user = user; - if (typeof window._elev.setUser !== "undefined") { + if (typeof window._elev.setUser !== 'undefined') { window._elev.setUser(user); } }; From 71e8d90179f1a180805a4389755c6c9257a5bb1c Mon Sep 17 00:00:00 2001 From: Chris Duell Date: Sat, 19 Aug 2017 09:38:16 +1000 Subject: [PATCH 07/14] Changing setUser function exists test to be more explicit --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 420e98f..0162a71 100644 --- a/lib/index.js +++ b/lib/index.js @@ -68,7 +68,7 @@ Elevio.prototype.identify = function(identify) { if (plan) user.groups = [plan]; if (objectKeys(traits).length > 0) user.traits = traits; window._elev.user = user; - if (typeof window._elev.setUser !== 'undefined') { + if (typeof window._elev.setUser !== 'function') { window._elev.setUser(user); } }; From 3c5b57185131a246d69bd88f48bc8620a534899c Mon Sep 17 00:00:00 2001 From: Chris Duell Date: Wed, 23 Aug 2017 09:59:23 +1000 Subject: [PATCH 08/14] Reversal of setUser function check logic --- HISTORY.md | 5 +++++ lib/index.js | 2 +- package.json | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 908be9e..45aa3ff 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,8 @@ +2.2.1 / 2017-08-23 +================== + + * Reversal of setUser function check logic + 2.2.0 / 2017-08-17 ================== diff --git a/lib/index.js b/lib/index.js index 0162a71..3604d79 100644 --- a/lib/index.js +++ b/lib/index.js @@ -68,7 +68,7 @@ Elevio.prototype.identify = function(identify) { if (plan) user.groups = [plan]; if (objectKeys(traits).length > 0) user.traits = traits; window._elev.user = user; - if (typeof window._elev.setUser !== 'function') { + if (typeof window._elev.setUser === 'function') { window._elev.setUser(user); } }; diff --git a/package.json b/package.json index e01792b..f54868c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@segment/analytics.js-integration-elevio", "description": "The Elevio analytics.js integration.", - "version": "2.2.0", + "version": "2.2.1", "keywords": [ "analytics.js", "analytics.js-integration", From 53efaa8babd2883a69f1866f486da83ea2b99b83 Mon Sep 17 00:00:00 2001 From: Chris Duell Date: Thu, 17 Aug 2017 09:41:35 +1000 Subject: [PATCH 09/14] Updated version to 2.2.0 --- HISTORY.md | 1 - 1 file changed, 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 45aa3ff..ad578ed 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,4 @@ 2.2.1 / 2017-08-23 -================== * Reversal of setUser function check logic From 33d37773363998052f165c0031c58fc3b1b0cab1 Mon Sep 17 00:00:00 2001 From: Chris Duell Date: Wed, 23 Aug 2017 09:59:23 +1000 Subject: [PATCH 10/14] Reversal of setUser function check logic --- HISTORY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/HISTORY.md b/HISTORY.md index ad578ed..45aa3ff 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,4 +1,5 @@ 2.2.1 / 2017-08-23 +================== * Reversal of setUser function check logic From fa2bfa8db77e9ad6a3ddf27702567b73208b1f85 Mon Sep 17 00:00:00 2001 From: Chris Duell Date: Thu, 4 Jan 2018 15:43:53 +1100 Subject: [PATCH 11/14] Remove assumesPageView option --- HISTORY.md | 5 +++++ lib/index.js | 1 - package.json | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 45aa3ff..2e8484b 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,8 @@ +2.3.0 / 2017-08-23 +================== + + * Remove assumesPageView option + 2.2.1 / 2017-08-23 ================== diff --git a/lib/index.js b/lib/index.js index 3604d79..8818117 100644 --- a/lib/index.js +++ b/lib/index.js @@ -11,7 +11,6 @@ var objectKeys = require('@ndhoule/keys'); */ var Elevio = module.exports = integration('Elevio') - .assumesPageview() .option('accountId', '') .global('_elev') .tag('