mercredi 19 août 2020

If function for CSS selector - GTM

I have very basic JS knowledge, so excuse me for such simple question.

How to create if function for the following situation:

if "CSS selector'= a, return 'text1'
if 'CSS selector'= b, return 'text2'
if 'CSS selector'= c, return ''text3'
otherwise return 'not set'

I need this to return the product category depending on clicked button. Click class/id is the same for all 3 buttons.

Thank You

Aucun commentaire:

Enregistrer un commentaire