User Properties - Question
FabianoLothor opened this issue · comments
Hello, first of all, thank you for the great library.
I've a few questions about the user properties, is anyone able to help me?
- GA4 docs isn't very clear about the user-properties, do you know if I can set any key-value there or they've specific user-properties that I can use?
- I know that I need to set up those user properties in the GA4 configurations, do you know what happens if I send a request with a user property that wasn't previously set up there? Will that still work fine? And the opposite, if I don't send an expected key?
- Do you've any links that might help me to understand better how to use the user-properties? The ones that I found in the GA4 docs weren't useful to understand certain detail.
Thank you for trying it out, it was originally developed for a specific business purpose.
The user properties are meant for users (not sessions). Let's use a webshop/e-comm example.
You have a client (visitor) that enters your website and browses, this is a simple session where you can see what the client looks at, puts in a basked, etc.
Later that client creates an account and ALSO becomes a user. You want to put some specific information to that user, that might be represented throughout the upcoming sessions.
Flow:
visits -> get session -> client id
view page
view page
signup -> set user id
buys something -> sets user property "first_purchase: now()"
visits -> get session -> client id && is logged in -> set user id
buys something worth €500 -> set user property "is_big_spender: yes"
Analytics:
I am not a marketer, so I am not very strong in the actual Analytics interface, but my understanding is that you should then be able to filter on "first_purchase" and/or "is_big_spender" variables when making a custom report on users.