Skip to main content

Hello!
Could you please tell me how i can increment (increase) the value of the attribute in customer.io ?
for example i have an attribute, called ‘number_of_page_views’ and i want it to increase it’s value by 1, every time user logins the page. (1,2,3,4 etc).

Hey Alex,

as long as you send an event or webhook to CIO in case the user logs in, you can do the following:

Create a campaign and simple add “create or update a person” in the workflow. There you can select your attribute number_of_page_views and use liquid to increase the value by 1 with the filter “plus” (in my case it named the attribute page_views):

 

Hope that helps,

Felix


Hey, Felix!
i did according to your advice.
It works fine if person has number_of_page_views attribute, but in case it does not have it,  there is an error. 
In case attribute number_of_page_views does not exist yet, we would like it to be created and incremented.
Can you please give an advice how we could fix this ?
Here are the screenshots of my current configuration,
Thanks in advance!
 


 



 

 


@Felix this worked for me:

{% if customer.number_of_page_views != blank %}
  {{customer.number_of_page_views | plus: 1 }}
{% else %}
  {{ 1 }}
{% endif %}


@alex_mustafa That would have been my solution as well. I think you don’t need the brackets before and after 1, but as long as it works you are good to go :)

 

Best,
Felix


Reply