@@ -21,6 +21,7 @@ import { useEffect, useRef, useState } from 'react';
2121import ReactGoogleRecaptcha from 'react-google-recaptcha' ;
2222import { submitComponentEvent } from '../client/ophan/ophan' ;
2323import { lazyFetchEmailWithTimeout } from '../lib/fetchEmail' ;
24+ import { useBrowserId } from '../lib/metrics' ;
2425import { clearSubscriptionCache } from '../lib/newsletterSubscriptionCache' ;
2526import { useAuthStatus , useIsSignedIn } from '../lib/useAuthStatus' ;
2627import { palette } from '../palette' ;
@@ -136,6 +137,7 @@ const buildFormData = (
136137 newsletterId : string ,
137138 token : string ,
138139 marketingOptIn ?: boolean ,
140+ browserId ?: string ,
139141) : FormData => {
140142 const pageRef = window . location . origin + window . location . pathname ;
141143 const refViewId = window . guardian . ophan ?. pageViewId ?? '' ;
@@ -155,6 +157,10 @@ const buildFormData = (
155157 formData . append ( 'marketing' , marketingOptIn ? 'true' : 'false' ) ;
156158 }
157159
160+ if ( browserId !== undefined ) {
161+ formData . append ( 'browserId' , browserId ) ;
162+ }
163+
158164 return formData ;
159165} ;
160166
@@ -304,6 +310,7 @@ export const SecureSignup = ({
304310 } ) ;
305311 } , [ ] ) ;
306312 const { renderingTarget } = useConfig ( ) ;
313+ const browserId = useBrowserId ( ) ;
307314
308315 const hasResponse = typeof responseOk === 'boolean' ;
309316
@@ -319,6 +326,7 @@ export const SecureSignup = ({
319326 newsletterId ,
320327 token ,
321328 marketingOptIn ,
329+ browserId ,
322330 ) ;
323331
324332 const response = await postFormData (
0 commit comments