Skip to main content
Solved

Using liquid syntax to dynamically update profile attribute based on other attribute


Forum|alt.badge.img+3

I’m trying to log two permanent attributes on new profiles, to determine the initial signup source and campaign, in which they signed up through. The use case is to be able to quickly and easily asses which lead sources and campaigns perform best. In order to do that, I want to set up two custom reports, showing conversion metrics, grouped by both initial signup source and initial signup campaign. 

We have multiple leadsources, like facebook lead ads, typeform, popups, youtube etc. Through the individual integrations, we include data into two attributes: recent_signup_source and recent_signup_campaign. 

The reason why I need two additional attributes (initial_signup_source & initial_signup_campaign), is because the data in recent_signup_source and recent_signup_campaign is overwritten every time a lead fills out a new form through one of our sources. In that case, we would otherwise lose the data of our original source and campaign, and therefor not be able to asses the value of the first lead source. 

The solution I’m trying to create, is to set up a flow in Klaviyo, with a segment-based trigger. 

Segment conditions: 
“recent_signup_source is not blank” and initial_signup_source is blank” 

In this way, I’ll only get new subscribers without the initial signup data in the segment. 

The flow only contains a “update profile property” action, with two configurations: 

  1. Update existing property - initial_signup_source = (the data in “recent_signup_source”)
  2. Update existing property - initial_signup_campaign = (the data in “recent_signup_campaign”)

This would in effect, simply copy the recent_ data, but would make sure that the initial_ data is not overwritten in the future. 

I’m trying to make this happen by using a liquid syntax to pull that data into the update existing property:

  1. Update existing property - initial_signup_source = {{ person|lookup:'recent_signup_source' }}
  2. Update existing property - initial_signup_campaign = {{ person|lookup:'recent_signup_campaign' }}

but it only pulls the “string” data, making the input in the two initial attributes this string text “{{ person|lookup:'recent_signup_campaign' }}” 

As far as I’ve been able to research on other posts

 &

, it’s not possible to pull this off. So I guess I’m looking for alternative ways to accomplish my first mentioned goal. 

Thanks in advance for helping out! 

Best answer by KeviSunshine

Hi @Freddy Angelo,

I’ve tried this exact thing before and the answer is using a webhook to call Klaviyo’s own APIs.

I talked about this in this post: 

 

That should be a simple solution to your problem :)

Cheers,

Kevin.

View original
Did this topic or the replies in the thread help you find an answer to your question?

2 replies

KeviSunshine
Expert Problem Solver III
Forum|alt.badge.img+8
  • Expert Problem Solver III
  • 158 replies
  • Answer
  • July 20, 2022

Hi @Freddy Angelo,

I’ve tried this exact thing before and the answer is using a webhook to call Klaviyo’s own APIs.

I talked about this in this post: 

 

That should be a simple solution to your problem :)

Cheers,

Kevin.


Forum|alt.badge.img+3
  • Author
  • Partner - Silver
  • 1 reply
  • July 20, 2022

Thanks @KeviSunshine

This worked like a charm. Appreciate your quick reply! :-)