File tree Expand file tree Collapse file tree 4 files changed +35
-5
lines changed Expand file tree Collapse file tree 4 files changed +35
-5
lines changed Original file line number Diff line number Diff line change
1
+ 2.3.0 / 2021-12-02
2
+ ==================
3
+
4
+ * Appcues now accepts the group Segment call!
5
+
1
6
2
7
2.2.0 / 2016-10-06
3
8
==================
Original file line number Diff line number Diff line change 5
5
*/
6
6
7
7
var integration = require ( '@segment/analytics.js-integration' ) ;
8
- var isObject = require ( 'isobject' ) ;
9
8
var load = require ( '@segment/load-script' ) ;
10
9
11
10
/**
@@ -36,7 +35,7 @@ Appcues.prototype.initialize = function() {
36
35
*/
37
36
38
37
Appcues . prototype . loaded = function ( ) {
39
- return isObject ( window . Appcues ) ;
38
+ return typeof window . Appcues === 'object' && window . Appcues != null ;
40
39
} ;
41
40
42
41
/**
@@ -90,6 +89,19 @@ Appcues.prototype.track = function(track) {
90
89
window . Appcues . track ( track . event ( ) , track . properties ( ) ) ;
91
90
} ;
92
91
92
+ /**
93
+ * Group.
94
+ *
95
+ * http://appcues.com/docs#group
96
+ *
97
+ * @api public
98
+ * @param {Group } group
99
+ */
100
+
101
+ Appcues . prototype . group = function ( group ) {
102
+ window . Appcues . group ( group . groupId ( ) , group . traits ( ) ) ;
103
+ } ;
104
+
93
105
/**
94
106
* Expose plugin.
95
107
*/
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @segment/analytics.js-integration-appcues" ,
3
3
"description" : " The Appcues analytics.js integration." ,
4
- "version" : " 2.2.1 " ,
4
+ "version" : " 2.3.0 " ,
5
5
"keywords" : [
6
6
" analytics.js" ,
7
7
" analytics.js-integration" ,
25
25
},
26
26
"dependencies" : {
27
27
"@segment/analytics.js-integration" : " ^2.1.0" ,
28
- "@segment/load-script" : " ^1.0.1" ,
29
- "isobject" : " ^2.1.0"
28
+ "@segment/load-script" : " ^1.0.1"
30
29
},
31
30
"devDependencies" : {
32
31
"@segment/analytics.js-core" : " ^3.0.0" ,
Original file line number Diff line number Diff line change @@ -115,5 +115,19 @@ describe('Appcues', function() {
115
115
} ) ;
116
116
} ) ;
117
117
} ) ;
118
+
119
+ describe ( '#group' , function ( ) {
120
+ beforeEach ( function ( ) {
121
+ analytics . stub ( window . Appcues , 'group' ) ;
122
+ } ) ;
123
+
124
+ it ( 'should send an id and group name' , function ( ) {
125
+ analytics . group ( 'id' , { groupName : 'group-1' } ) ;
126
+ analytics . called ( window . Appcues . group , 'id' , {
127
+ groupName : 'group-1' ,
128
+ id : 'id'
129
+ } ) ;
130
+ } ) ;
131
+ } ) ;
118
132
} ) ;
119
133
} ) ;
You can’t perform that action at this time.
0 commit comments