Use If/Else about the lifecycle stage on the visitor inside a custom coded Hubl template (for CTAs)

Highlighted
Regular Contributor

Hi there,
i would like to be able to use smart content (content based on the lifecycle stage) and A/B testing for my CTAs at the same time.

I did our website on Hubspot on i know the code.
The way i imagine it (as we can't do Smart Content AND A/B testing on a CTA at the same time), is to have only A/B Testing on my CTA and have a if/else condition about the lifecycle stage of the visitor inside my Hubl template.

Is that doable?
Is there a variable i could use?

Thanks!

Reply
0 Upvotes
1 Reply 1
Highlighted
HubSpot Alumni

Hey Sebastian,

Your code would look something like this:

{% if contact.lifecycle_stage = "x"  %}
{{ CTA }} 
{% elif contact.lifecycle_stage = "y" %}
{{ CTA }}
{% endif %}

This would need to be built out within a custom module.

Reply
0 Upvotes