Solved

Back In Stock - Not Working

  • 8 May 2024
  • 8 replies
  • 188 views

Badge

So a couple a days ago Back In Stock, stopped working for my client. At this point i’m about ready to give up. I debugged the thing quite a lot and now i’m getting some errors from klaviyo utils. Bellow you can see console logs.

Unable to process event: init,[object Object],function(i){t&&t(i),n(i)} sharedUtils.aaa4a40f3112b6f3f60b.js:1:2269
Unable to process event: enable,backinstock,[object Object],function(i){t&&t(i),n(i)} sharedUtils.aaa4a40f3112b6f3f60b.js:1:2269

My configuration is this (yes, i replaced the ACCOUNT_ID accordingly, i only shared it here like this so i don’t leak the account_id, lol):

var klaviyo = klaviyo || [];
klaviyo.init({
account: "ACCOUNT_ID",
platform: "shopify"
});
klaviyo.enable("backinstock", {
trigger: {
product_page_text: "Notify Me When Available",
product_page_class: "klaviyo-bis-trigger",
product_page_text_align: "center",
product_page_margin: "0px",
replace_anchor: false
},
modal: {
headline: "{product_name}",
body_content: "Register to receive a notification when this item comes back in stock.",
email_field_label: "Email",
button_label: "Notify me when available",
subscription_success_label: "You're in! We'll let you know when it's back.",
footer_content: '',
additional_styles: "@import url('https://fonts.googleapis.com/css?family=Helvetica+Neue');",
drop_background_color: "#000",
background_color: "#fff",
text_color: "#222",
button_text_color: "#fff",
button_background_color: "#439fdb",
close_button_color: "#ccc",
error_background_color: "#fcd6d7",
error_text_color: "#C72E2F",
success_background_color: "#d3efcd",
success_text_color: "#1B9500"
}
});

So at one point i got an error, that said something along the lines of: “ID not found, undefined set to 0” or something, so i added a hidden input that said product-id and the product selected or first available product id. So i got rid of that error. Now whenever i hit the link, i get sent to the top and the url gets a #.

 

Is it because the trigger is an anchor? Should i make it a button? Is there something wrong with klavio bis? Did something happen a few days ago? What am i doing wrong?

icon

Best answer by Brian Turcotte 13 June 2024, 18:22

View original

8 replies

Userlevel 7
Badge +36

Hi @lexfan!

Just to clarify - this was working completely perfectly, and then nothing changes on the site’s end, and it’s now not working? Also - is this is a totally custom site, or is it one of our pre-built integration with an e-commerce platform (like Shopify, etc.)?
 

- Brian

Badge

Hello Brian,

 

This is a completely custom site. Yes before it used to work perfectly. However even tho’ i’m the main developer someone other than myself might have tested something. I’ve read that there is a posibility i can do some custom functionality doing a POST at an endpoint of sorts. Where can i find documentation for this?

Note: I’ve redone the entire BIS implementation from scratch and nothing happens.

Badge

Hi @lexfan 

 

did you end up solving this? we just stared experiencing the same thing.

 

Badge +5

Hi @lexfan 

Commenting here because as I upgrade Google Tag Manager-based JS tags from the old _learnq method to the callback approach mentioned here, I am seeing this error.

Did you or @james-ap get a resolution to this issue?

Thanks

Userlevel 7
Badge +36

Hi @lexfan!

I have created a Support ticket on your behalf as this is a highly account-specific issue, so Support will be more equipped to handle this.

 

Best,

Brian

 

 

Badge

I’m having the same issue on my site in that it was working and has now abruptly stopped so I assume some JS on Klaviyo’s side has changed but when I went through support I spent time trying to debug it and show examples etc (previous to failing completely it worked on everything but Android) and then as soon as they couldn’t advise on a fix or ID the problem I was dropped because my site is also a custom theme. 

 

Now I’m going to have to install another 3rd party Shopify app for this functionality which is deeply frustrating. I’d love for Klaviyo to offer the option of a simple link to a new page for stock notifications alongside the modal. 

Badge

Hello everybody, am back and the issue still persists. Even tried a different theme, tried on Dawn, tried on Spotlight. Same error.

Badge

@Brian Turcotte Where is that ticket exactly?

Reply