File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
dotcom-rendering/src/components Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -261,6 +261,10 @@ export const ManyNewsletterSignUp = ({
261261 return undefined ;
262262 } ) ;
263263
264+ const marketingOptInType = marketingOptIn
265+ ? 'similar-guardian-products-optin'
266+ : 'similar-guardian-products-optout' ;
267+
264268 if ( ! response ?. ok ) {
265269 const responseText = response
266270 ? await response . text ( )
@@ -271,6 +275,7 @@ export const ManyNewsletterSignUp = ({
271275 renderingTarget ,
272276 {
273277 listIds,
278+ ...( marketingOptIn !== undefined && { marketingOptInType } ) ,
274279 // If the backend handles the failure and responds with an informative
275280 // error message (E.G. "Service unavailable", "Invalid email" etc) this
276281 // should be included in the event data.
@@ -289,6 +294,7 @@ export const ManyNewsletterSignUp = ({
289294 renderingTarget ,
290295 {
291296 listIds,
297+ ...( marketingOptIn !== undefined && { marketingOptInType } ) ,
292298 } ,
293299 ) ;
294300 setStatus ( 'Success' ) ;
You can’t perform that action at this time.
0 commit comments