File tree Expand file tree Collapse file tree 8 files changed +51
-14
lines changed Expand file tree Collapse file tree 8 files changed +51
-14
lines changed Original file line number Diff line number Diff line change 44 * Module dependencies.
55 */
66
7- var cookie = require ( 'component -cookie' ) ;
7+ var cookie = require ( 'js -cookie' ) ;
88var integration = require ( '@segment/analytics.js-integration' ) ;
99var load = require ( '@segment/load-script' ) ;
1010var querystring = require ( 'component-querystring' ) ;
@@ -93,9 +93,9 @@ Pardot.prototype.getRequestVariables = function() {
9393 var variables = {
9494 account_id : window . piAId ,
9595 campaign_id : window . piCId ,
96- pi_opt_in : cookie ( 'pi_opt_in' + ( this . options . piAId - 1e3 ) ) ,
96+ pi_opt_in : cookie . get ( 'pi_opt_in' + ( this . options . piAId - 1e3 ) ) ,
9797 ver : 3 ,
98- visitor_id : cookie ( 'visitor_id' + ( this . options . piAId - 1e3 ) )
98+ visitor_id : cookie . get ( 'visitor_id' + ( this . options . piAId - 1e3 ) )
9999 } ;
100100
101101 // get all the query parameters
Original file line number Diff line number Diff line change 11{
22 "name" : " @segment/analytics.js-integration-pardot" ,
33 "description" : " The Pardot analytics.js integration." ,
4- "version" : " 2.0.1 " ,
4+ "version" : " 2.0.2 " ,
55 "keywords" : [
66 " analytics.js" ,
77 " analytics.js-integration" ,
2626 "dependencies" : {
2727 "@segment/analytics.js-integration" : " ^3.3.2" ,
2828 "@segment/load-script" : " ^1.0.1" ,
29- "component -cookie" : " ^1.1.2 " ,
29+ "js -cookie" : " ^2.2.1 " ,
3030 "component-querystring" : " ^1.3.3" ,
3131 "use-https" : " ^0.1.1"
3232 },
Original file line number Diff line number Diff line change 66
77var ads = require ( '@segment/ad-params' ) ;
88var clone = require ( 'component-clone' ) ;
9- var cookie = require ( 'component -cookie' ) ;
9+ var JSCookie = require ( 'js -cookie' ) ;
1010var extend = require ( '@ndhoule/extend' ) ;
1111var integration = require ( '@segment/analytics.js-integration' ) ;
1212var keys = require ( '@ndhoule/keys' ) ;
@@ -24,7 +24,7 @@ var Queue = require('@segment/localstorage-retry');
2424
2525var cookieOptions = {
2626 // 1 year
27- maxage : 31536000000 ,
27+ maxage : ' 31536000000' ,
2828 secure : false ,
2929 path : '/'
3030} ;
@@ -64,6 +64,21 @@ var Segment = (exports = module.exports = integration('Segment.io')
6464 . option ( 'addBundledMetadata' , false )
6565 . option ( 'unbundledIntegrations' , [ ] ) ) ;
6666
67+ var cookie = function ( name , value , options ) {
68+ switch ( arguments . length ) {
69+ case 3 :
70+ case 2 :
71+ if ( value === null ) {
72+ return JSCookie . remove ( name , { path : '' } )
73+ }
74+ return JSCookie . set ( name , value , options ) ;
75+ case 1 :
76+ return JSCookie . get ( name ) ;
77+ default :
78+ return JSCookie . get ( ) ;
79+ }
80+ } ;
81+
6782/**
6883 * Get the store.
6984 *
Original file line number Diff line number Diff line change 11{
22 "name" : " @segment/analytics.js-integration-segmentio" ,
33 "description" : " The Segmentio analytics.js integration." ,
4- "version" : " 4.2.6 " ,
4+ "version" : " 4.2.7 " ,
55 "keywords" : [
66 " analytics.js" ,
77 " analytics.js-integration" ,
3434 "@segment/top-domain" : " ^3.0.0" ,
3535 "@segment/utm-params" : " ^2.0.0" ,
3636 "component-clone" : " ^0.2.2" ,
37- "component -cookie" : " ^1.1.2 " ,
37+ "js -cookie" : " ^2.2.1 " ,
3838 "component-type" : " ^1.2.1" ,
3939 "uuid" : " ^2.0.2" ,
4040 "yields-store" : " ^1.0.2"
Original file line number Diff line number Diff line change 33var Analytics = require ( '@segment/analytics.js-core' ) . constructor ;
44var Segment = require ( '../lib/' ) ;
55var assert = require ( 'proclaim' ) ;
6- var cookie = require ( 'component -cookie' ) ;
6+ var JSCookie = require ( 'js -cookie' ) ;
77var integration = require ( '@segment/analytics.js-integration' ) ;
88var protocol = require ( '@segment/protocol' ) ;
99var sandbox = require ( '@segment/clear-env' ) ;
@@ -21,6 +21,23 @@ var lolex = require('lolex');
2121// this hackery
2222var isPhantomJS = / P h a n t o m J S / . test ( window . navigator . userAgent ) ;
2323
24+
25+ var cookie = function ( name , value , options ) {
26+ switch ( arguments . length ) {
27+ case 3 :
28+ case 2 :
29+ if ( value === null ) {
30+ return JSCookie . remove ( name , { path : '' } )
31+ }
32+ return JSCookie . set ( name , value , options ) ;
33+ case 1 :
34+ return JSCookie . get ( name ) ;
35+ default :
36+ return JSCookie . get ( ) ;
37+ }
38+ } ;
39+
40+
2441describe ( 'Segment.io' , function ( ) {
2542 var segment ;
2643 var analytics ;
Original file line number Diff line number Diff line change 44 * Module dependencies.
55 */
66
7- var cookie = require ( 'component -cookie' ) ;
7+ var cookie = require ( 'js -cookie' ) ;
88var integration = require ( '@segment/analytics.js-integration' ) ;
99var push = require ( 'global-queue' ) ( '_veroq' ) ;
1010
@@ -31,7 +31,7 @@ Vero.prototype.initialize = function() {
3131 // basically, they have window.addEventListener('unload')
3232 // which then saves their "command_store", which is an array.
3333 // so we just want to create that initially so we can reload the tests.
34- if ( ! cookie ( '__veroc4' ) ) cookie ( '__veroc4' , '[]' ) ;
34+ if ( ! cookie . get ( '__veroc4' ) ) cookie . set ( '__veroc4' , '[]' ) ;
3535 push ( 'init' , { api_key : this . options . apiKey } ) ;
3636 this . load ( this . ready ) ;
3737} ;
Original file line number Diff line number Diff line change 11{
22 "name" : " @segment/analytics.js-integration-vero" ,
33 "description" : " The Vero analytics.js integration." ,
4- "version" : " 2.2.0 " ,
4+ "version" : " 2.2.1 " ,
55 "keywords" : [
66 " analytics.js" ,
77 " analytics.js-integration" ,
2525 },
2626 "dependencies" : {
2727 "@segment/analytics.js-integration" : " ^3.3.2" ,
28- "component -cookie" : " ^1.1.2 " ,
28+ "js -cookie" : " ^2.2.1 " ,
2929 "global-queue" : " ^1.0.1"
3030 },
3131 "devDependencies" : {
Original file line number Diff line number Diff line change @@ -6736,6 +6736,11 @@ jquery@^2.2.4:
67366736 resolved "https://registry.yarnpkg.com/jquery/-/jquery-2.2.4.tgz#2c89d6889b5eac522a7eea32c14521559c6cbf02"
67376737 integrity sha1-LInWiJterFIqfuoywUUhVZxsvwI=
67386738
6739+ js-cookie@^2.2.1 :
6740+ version "2.2.1"
6741+ resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-2.2.1.tgz#69e106dc5d5806894562902aa5baec3744e9b2b8"
6742+ integrity sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ==
6743+
67396744js-sha256@^0.3.0 :
67406745 version "0.3.2"
67416746 resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.3.2.tgz#db09592455164191ce8171a4888cd957c67bf0ed"
You can’t perform that action at this time.
0 commit comments