Skip to main content
Question

Back in stock form with required checkbox

  • February 2, 2026
  • 4 replies
  • 21 views

Forum|alt.badge.img+4

Hello.

We are facing a problem with our custom back in stock sign u form. We are trying to make the opt-in checkbox required. Why? Because we are sending to profiles that subscribed and never subscribed since some of them are just subscribers and some of them just customers. So the 2 options we have is 

  • subscribe to back in stock with no promotional emails → Never subscribed - not in back in stock list
  • subscribe to back in stock with promotional emails → Subscribed to email list

So if you unsubscribed and subscribe to back in stock, your status will change to never subscribed and you will start getting emails. We tried to think all options but there is always overlap (e.g. ok, exclude all subscribed to back in stock list from newsletters. But what if they were already receiving?). Imaging having this in complex segmentation.

So for now making the “receive promotional emails” check box required seems like the cleanest option. The script we used is this one. Any ideas on how to make the checkbox required?

 

<script src="https://a.klaviyo.com/media/js/onsite/onsite.js"></script>
<script>
var klaviyo = klaviyo || [];

klaviyo.init({
account: '[ACCOUNT_ID]',
platform: 'shopify',
list: '[LIST_ID]',
});

klaviyo.enable('backinstock', {
trigger: {
product_page_text: "{{ 'general.klaviyo.product_page_text' | t }}",
product_page_class: 'button w-full',
product_page_text_align: 'center',
product_page_margin: '0px',
replace_anchor: true,
},
modal: {
headline: '{product_name}',
body_content: "{{ 'general.klaviyo.body_content' | t }}",
email_field_label: "{{ 'general.klaviyo.email_field_label' | t }}",
button_label: "{{ 'general.klaviyo.button_label' | t }}",
subscription_success_label: "{{ 'general.klaviyo.subscription_success_label' | t }}",
footer_content: '',
additional_styles: "@import url('{{ 'klaviyo-bis-modal.css' | asset_url }}');",
drop_background_color: '#000',
background_color: '#fff',
text_color: 'var(--text-color-default);',
button_text_color: '#fff',
button_background_color: 'rgb(78, 60, 50)',
close_button_color: '#ccc',
error_background_color: '#fcd6d7',
error_text_color: '#C72E2F',
success_background_color: '#d3efcd',
success_text_color: '#1B9500',
newsletter_subscribe_label: "{{ 'general.klaviyo.newsletter_subscribe_label' | t }}",
},
});
</script>
 

4 replies

whereisjad
Expert Problem Solver IV
Forum|alt.badge.img+17
  • Expert Problem Solver IV
  • February 2, 2026

@Alexandros just to make sure I understand the end goal, you wish to make subscribing to back in stock contingent on your customer consenting to email marketing?

 

I have another suggestion, do away with the check box and add a disclaimer that subscribing to back in stock is consenting to email marketing.  On the Klaviyo side you could set up a flow triggered by the subscribed to back in stock event and includes a webhook action step to call Klaviyo APIs to add email consent. Would look like below:

 

POST https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs

 

Authorization: Klaviyo-API-Key your-private-api-key

accept: application/vnd.api+json

revision: 2025-10-15

{

"data": {

"type": "profile-subscription-bulk-create-job",

"attributes": {

"profiles": {

"data": [

{

"type": "profile",

"id": "{{ person.KlaviyoID }}",

"attributes": {

"email": "{{ person.email }}",

"subscriptions": {

"email": {

"marketing": {

"consent": "SUBSCRIBED"

}

}

}

}

}

]

}

}

}

}

 


Forum|alt.badge.img+4
  • Author
  • Contributor I
  • February 2, 2026

@whereisjad thank you for your response. I get your logic but i would like to keep the “Subscribed” “Never Subscribed” statuses clean so they actually mean something when segmenting users.

But to be honest, just adding a disclaimer might do the trick. :)


whereisjad
Expert Problem Solver IV
Forum|alt.badge.img+17
  • Expert Problem Solver IV
  • February 2, 2026

@Alexandros was your intention to have checkbox checked by default that users have to uncheck it to reject email consent but still be capable of subscribing to back in stock?  

 

For that angle you would need to add a JS that executes after page load to force the checkbox to be checked.


Forum|alt.badge.img+4
  • Author
  • Contributor I
  • February 2, 2026

@Alexandros was your intention to have checkbox checked by default that users have to uncheck it to reject email consent but still be capable of subscribing to back in stock?  

 

For that angle you would need to add a JS that executes after page load to force the checkbox to be checked.

No. Actually that is not allowed GDPR wise. We need to have this unchecked