Solved

I would like to trigger a popup by clicking on specific text

  • 4 July 2023
  • 3 replies
  • 138 views

Badge

Hi,

 

I have tried this solution on Klaviyo website but this is not working at somehow. I don't have the expertise to code I understand it a bit but I don't know why It is not working.

I would like to have a pop-up which is triggered by a text. The pop-up gives more explanation to the customer.

<button class="klaviyo_form_trigger">Wat is je maat?</button>

 

<script type="text/javascript">
document.querySelector('.klaviyo_form_trigger').addEventListener('click', function (){
window._klOnsite = window._klOnsite || [];
window._klOnsite.push(['openForm', 'TKGULa']);
});
</script>

I guess I do something wrong but I don't know what. 

icon

Best answer by David To 5 July 2023, 21:50

View original

3 replies

Userlevel 7
Badge +37

Hi @Wesley 

The script looks good to me!

Some things to check:

  1. Is the form TKGULa published (status of ‘Live’)?
  2. Is your browser blocking javascript?
  3. Do you have any other Klaviyo pop-ups on your site that are working OK?
  4. Related to 3, have you enabled onsite tracking ? More info here: https://help.klaviyo.com/hc/en-us/articles/360026474752

Hope one of those fixes your issue!

Regards

Andy

Badge

Everything is correct but at some point the pop-up triggers the shopbasket. Which mean the customer goes straight to the shop basket.

Userlevel 7
Badge +60

Great suggestions @bluesnapper!

@Wesley, by “shopbasket” do you mean the cart page? If so, then this sounds like there’s some coding conflict on your site with that Klaviyo code. Most likely caused by another script tied to the text or behavior.

I would suggest working alongside your developer to review your site code closely to resolve this conflict. If you need an introduction to a developer, we have a large network of Klaviyo Partners who can help in this area. 

I hope this helps!

David

Reply