File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
packages/script/src/extensions Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,8 @@ const initConversionTracking = () => {
1919 // Track lead conversion
2020 const trackLead = async ( input ) => {
2121 const clickId = cookieManager ?. get ( DUB_ID_VAR ) ;
22-
2322 const requestBody = {
24- ... ( clickId && { clickId } ) ,
23+ clickId : clickId ?? '' ,
2524 ...input ,
2625 } ;
2726
@@ -45,13 +44,18 @@ const initConversionTracking = () => {
4544
4645 // Track sale conversion
4746 const trackSale = async ( input ) => {
47+ const clickId = cookieManager ?. get ( DUB_ID_VAR ) ;
48+ const requestBody = {
49+ clickId : clickId ?? '' ,
50+ ...input ,
51+ } ;
4852 const response = await fetch ( `${ API_HOST } /track/sale/client` , {
4953 method : 'POST' ,
5054 headers : {
5155 'Content-Type' : 'application/json' ,
5256 Authorization : `Bearer ${ PUBLISHABLE_KEY } ` ,
5357 } ,
54- body : JSON . stringify ( input ) ,
58+ body : JSON . stringify ( requestBody ) ,
5559 } ) ;
5660
5761 const result = await response . json ( ) ;
You can’t perform that action at this time.
0 commit comments