Hey there,
I’m trying to add some code to my theme.liquid via a snippet called “e_commerce_events”. In this snippet I want to include code that executes a script every time an e-commerce event happens, f.e.:
{% if template == ‘product’ %}
{% endif %}
For the view_item event this is obviously pretty simple and straight forward. However, I am more of a digital marketer and not so much of a developer and I’m struggling with the implementation of events where I cannot use a static state (like template == ‘product’) as a trigger but an actual event like the add_to_cart event. I’m thinking about something like this:
{% if product.add %}
{% endif %}
I tried a few things here and checked the liquid cheat sheet but I can’t really get to a working solution. However, I assume this must be somehow possible and it can’t really be that difficult, right?
I would appreciate it very much if someone could help me out here.
Thanks a lot and kind regards!
Ole