Question

Back In Stock - Not Working


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?


2 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.

Reply