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+
16
272.2.0 / 2016-10-06
38==================
Original file line number Diff line number Diff line change 55 */
66
77var integration = require ( '@segment/analytics.js-integration' ) ;
8- var isObject = require ( 'isobject' ) ;
98var load = require ( '@segment/load-script' ) ;
109
1110/**
@@ -36,7 +35,7 @@ Appcues.prototype.initialize = function() {
3635 */
3736
3837Appcues . prototype . loaded = function ( ) {
39- return isObject ( window . Appcues ) ;
38+ return typeof window . Appcues === 'object' && window . Appcues != null ;
4039} ;
4140
4241/**
@@ -90,6 +89,19 @@ Appcues.prototype.track = function(track) {
9089 window . Appcues . track ( track . event ( ) , track . properties ( ) ) ;
9190} ;
9291
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+
93105/**
94106 * Expose plugin.
95107 */
Original file line number Diff line number Diff line change 11{
22 "name" : " @segment/analytics.js-integration-appcues" ,
33 "description" : " The Appcues analytics.js integration." ,
4- "version" : " 2.2.1 " ,
4+ "version" : " 2.3.0 " ,
55 "keywords" : [
66 " analytics.js" ,
77 " analytics.js-integration" ,
2525 },
2626 "dependencies" : {
2727 "@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"
3029 },
3130 "devDependencies" : {
3231 "@segment/analytics.js-core" : " ^3.0.0" ,
Original file line number Diff line number Diff line change @@ -115,5 +115,19 @@ describe('Appcues', function() {
115115 } ) ;
116116 } ) ;
117117 } ) ;
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+ } ) ;
118132 } ) ;
119133} ) ;
You can’t perform that action at this time.
0 commit comments