Store user session and cookies/consent in Firestore

Hi I hope something can help me or point me i the right direction.

How would I go about storing a user session with cookies and consent and save it in Firebase?
I need to use it so i can use consent on a Tag where the trigger is a webhook.

Anyoe can help point me in the right direction?

Thanks!

For me, on client side GTM, I retrieve the cookie data and send it through Data Tag. On server side GTM, I will use the tags provided by Stape to write those parameters (that contains the cookie value) into Firebase.
The thing I’m on the fence about is whether I should use _ga cookie value or Stape User ID as the document key to persist the data through multiple domains and/or sessions.

Do you know why my firestore lookup variable returns undefined on all other events than the one i use to write the data into firestore.

You can see here that is works on my “kontakt_fb” event, which is the event that also writes the data into firestore. But i need that email address from the lookup variable to also show on my other events.

You can see here on my pageview event its undefined. what am i doin wrong?

this is how i set it up:

@Dan Hi , can you perhaps help me here ? i really dont know where it goes wrong

@jeppe_Nielsen

  1. Not certain from the top of my head, by I think collection path should be w/o spaces
  2. You query condition refers to email_address but you’re trying to return user_data.email_address