Google Tag Manager

Forum Discussion

2000andjames's avatar
2000andjames
Supporter
28 days ago
Solved

Liquid: Can I add a variable to abort_message() function

Is there a way to pass in a variable or attribute when using abort_message() function? I've checked the documentation but I can't see a way to do it. I've tested variations and can only get plain t...
  • Arso's avatar
    27 days ago

    The Braze documentation explicitly says that you can't use Liquid within the abort statement – you must use strings. That's not explained on the documentation page you've linked above, but it is on the connected content documentation page

    I imagine that you would conditionally assign a value to the abort_reason variable. Why not do the abort_message conditionally? Something along the lines of:

    {% if criteria for abort reason 1 %}
    {% abort_message('reason1') %}
    {% elsif criteria for abort reason 2 %}
    {% abort_message('reason2') %}
    {% else %}
    {% endif %}