Help with Stape Store and lookup

Hi,

I am sending a webhook from Klaviyo to our server when a new lead gets in the newsletter.

I am then using Store Writer to store the event data from the webhook in Stape Store.
For the document key i am using the email from Klaviyo webhook event data.

Then im using the Stape Store lookup variable where in document ID i also have the Klaviyo email from the event data, and the key path is email because thats how it is in Stape Store.

My problem is that i am only getting the email from the lookup variable on the webhook event in the datastream, but i need it to work on my other events like view item, atc etc for that specific user because i have their email since they have signed up to our newsletter, but it is returning undefined.

What am i doing here?


It is likely returning undefined because there’s no email input on view_item, ATC etc, meaning the following is not true for those events:

also have the Klaviyo email from the event data, and the key path is email because thats how it is in Stape Store.

launch preview mode and see what it is that you’re trying to lookup

I ended up doing something else:

When someone would sign up to our newsletter i would set a cookie with email as the value. This cookie i would parse to our server and retrieve it as a 1 party cookie, and then store that in Stape Store.

This seemed to work when doin the lookup variable and its now returning the correct email across all events when i take a look.

What do you think about the method?

Hey @jeppe_Nielsen ,

That seems logical, should work without any problems

Problem is, this will not work if running lead ads on Meta, where people signup on Meta and never get on the website tho