@@ -31,6 +31,9 @@ describe('Integration Capture', () => {
3131 // Mock the query params capture function because we cannot mock window.location.href
3232 sinon . stub ( window . mParticle . getInstance ( ) . _IntegrationCapture , 'getQueryParams' ) . returns ( {
3333 fbclid : '1234' ,
34+ gclid : '234' ,
35+ gbraid : '6574' ,
36+ wbraid : '1234111' ,
3437 } ) ;
3538
3639 mParticle . init ( apiKey , window . mParticle . config ) ;
@@ -59,9 +62,13 @@ describe('Integration Capture', () => {
5962 expect ( testEvent ) . to . have . property ( 'data' ) ;
6063 expect ( testEvent . data ) . to . have . property ( 'event_name' , 'Test Event' ) ;
6164 expect ( testEvent . data ) . to . have . property ( 'custom_flags' ) ;
65+
6266 expect ( testEvent . data . custom_flags ) . to . deep . equal ( {
6367 'Facebook.ClickId' : `fb.1.${ initialTimestamp } .1234` ,
6468 'Facebook.BrowserId' : '54321' ,
69+ 'GoogleEnhancedConversions.Gclid' : '234' ,
70+ 'GoogleEnhancedConversions.Gbraid' : '6574' ,
71+ 'GoogleEnhancedConversions.Wbraid' : '1234111' ,
6572 } ) ;
6673 } ) ;
6774
@@ -83,6 +90,9 @@ describe('Integration Capture', () => {
8390 expect ( testEvent . data . custom_flags ) . to . deep . equal ( {
8491 'Facebook.ClickId' : 'passed-in' ,
8592 'Facebook.BrowserId' : '54321' ,
93+ 'GoogleEnhancedConversions.Gclid' : '234' ,
94+ 'GoogleEnhancedConversions.Gbraid' : '6574' ,
95+ 'GoogleEnhancedConversions.Wbraid' : '1234111' ,
8696 } ) ;
8797 } ) ;
8898
@@ -104,6 +114,9 @@ describe('Integration Capture', () => {
104114 expect ( testEvent . data . custom_flags ) . to . deep . equal ( {
105115 'Facebook.ClickId' : `fb.1.${ initialTimestamp } .1234` ,
106116 'Facebook.BrowserId' : '54321' ,
117+ 'GoogleEnhancedConversions.Gclid' : '234' ,
118+ 'GoogleEnhancedConversions.Gbraid' : '6574' ,
119+ 'GoogleEnhancedConversions.Wbraid' : '1234111' ,
107120 } ) ;
108121 } ) ;
109122
@@ -123,6 +136,9 @@ describe('Integration Capture', () => {
123136 expect ( testEvent . data . custom_flags ) . to . deep . equal ( {
124137 'Facebook.ClickId' : 'passed-in' ,
125138 'Facebook.BrowserId' : '54321' ,
139+ 'GoogleEnhancedConversions.Gclid' : '234' ,
140+ 'GoogleEnhancedConversions.Gbraid' : '6574' ,
141+ 'GoogleEnhancedConversions.Wbraid' : '1234111' ,
126142 } ) ;
127143 } ) ;
128144
@@ -158,6 +174,9 @@ describe('Integration Capture', () => {
158174 foo : 'bar' ,
159175 'Facebook.ClickId' : `fb.1.${ initialTimestamp } .1234` ,
160176 'Facebook.BrowserId' : '54321' ,
177+ 'GoogleEnhancedConversions.Gclid' : '234' ,
178+ 'GoogleEnhancedConversions.Gbraid' : '6574' ,
179+ 'GoogleEnhancedConversions.Wbraid' : '1234111' ,
161180 } ) ;
162181 } ) ;
163182
@@ -193,6 +212,9 @@ describe('Integration Capture', () => {
193212 expect ( testEvent . data . custom_flags ) . to . deep . equal ( {
194213 'Facebook.ClickId' : 'passed-in' ,
195214 'Facebook.BrowserId' : '54321' ,
215+ 'GoogleEnhancedConversions.Gclid' : '234' ,
216+ 'GoogleEnhancedConversions.Gbraid' : '6574' ,
217+ 'GoogleEnhancedConversions.Wbraid' : '1234111' ,
196218 } ) ;
197219 } ) ;
198220
@@ -228,6 +250,9 @@ describe('Integration Capture', () => {
228250 foo : 'bar' ,
229251 'Facebook.ClickId' : `fb.1.${ initialTimestamp } .1234` ,
230252 'Facebook.BrowserId' : '54321' ,
253+ 'GoogleEnhancedConversions.Gclid' : '234' ,
254+ 'GoogleEnhancedConversions.Gbraid' : '6574' ,
255+ 'GoogleEnhancedConversions.Wbraid' : '1234111' ,
231256 } ) ;
232257 } ) ;
233258
@@ -263,6 +288,9 @@ describe('Integration Capture', () => {
263288 expect ( testEvent . data . custom_flags ) . to . deep . equal ( {
264289 'Facebook.ClickId' : 'passed-in' ,
265290 'Facebook.BrowserId' : '54321' ,
291+ 'GoogleEnhancedConversions.Gclid' : '234' ,
292+ 'GoogleEnhancedConversions.Gbraid' : '6574' ,
293+ 'GoogleEnhancedConversions.Wbraid' : '1234111' ,
266294 } ) ;
267295 } ) ;
268296} ) ;
0 commit comments