Solved

Event Trigger Pulling in html & Css into event

  • 4 February 2021
  • 4 replies
  • 647 views

Badge +2

Hi Community 
Our Abandoned Cart Email is pulling in unwanted html. I have tried a number variables to change this.
I am wondering how I can correct this

 

icon

Best answer by retention 4 February 2021, 05:51

View original

4 replies

Userlevel 7
Badge +57

@Shiv_Siobhan - It seems like your custom event for “Added to Cart” is passing in the HTML tags as part of the Event data.  Check your Klaviyo Tracking Event to see if you can clean up the data before passing it in. 

If you want a quick temporary fix, you can also “Strip HTML” by adding an additional variable Filter for your Price Event Variables called striptags . Klaviyo supports most of the “Django Filters” to modify variables on the fly.

For example, for the “Price” it might look like:

{% item.line_price|striptags %}

This *should* remove any HTML Tags that might be in your variable item.line_price and then format it to two decimal places.

However, the better solution is to pass in the data correctly, because other aspects will depend on the data being accurate down the line!

If you need more help, copy/paste your “Added to Cart” event tracking code and/or your template code and I’m sure we can be more helpful!

Badge +2

Thank you - I tried the item.line_price | striptags. received a did you forget to register or load this tag?
I am new Klaviyo so trying to understand all the moving parts. 

Userlevel 7
Badge +57

Thank you - I tried the item.line_price | striptags. received a did you forget to register or load this tag?
I am new Klaviyo so trying to understand all the moving parts. 


Seems like you have added extra spaces around the “|” part. That can cause errors. Please try to copy/paste this line and see if it works:
 

{% currency_format item.line_price|striptags|floatformat:2 %}

 

Badge +1

Hi,

What if I want to pass a formatted html to event variable like “Abc <br /> Def”,

as you see I want a line break between above strings passing though single message in single event variable.

 

Thank You 

Reply