Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create audience based on dynamic user property

I have an app in which a user can have a "paid" or "free" status. A user can switch from "free" to "paid" (if he does an in app purchase) or from "paid" to "free" if he stops to pay its subscription.

Can I use a dynamic user property to track the information in Firebase ?

In the doc it is not clear if it is allowed to have a dynamic user property value that can change over time (https://support.google.com/firebase/answer/6317519?hl=en)

If it is not a good practice, how is it possible to do such a thing ?

Thanks

like image 552
Rémi Pradal Avatar asked Aug 09 '16 08:08

Rémi Pradal


3 Answers

As mentioned, user is permanently in an audience and when property changes it will be part of multiple audiences based on the same property, assuming there is an audience for all property values.

I have found that one way to work around this is to create a copy of an audience and delete the original one every once in a while. It would be even better if Firebase allowed resetting the audience content.

This works if the users are active and the audience will be re-gathered quickly. It will not work if you need the audience for reaching old inactive users.

like image 187
diidu Avatar answered Oct 19 '22 13:10

diidu


User property is a perfect choice for that.

The way user property work is that, once you set a user property, all the event track afterwards "contain" the value of that user property (BigQuery export format makes it quite obvious). In practice it mean that if you do (UP = User Property):

  1. Set UP "subscription" to "free"
  2. Track events like "watch_film" or whatever
  3. Set UP "subscription" to "paid"
  4. Track events [...]

All the events in step 2 are "within" the UP "subscription=free" and all the events in 4 are "within" the UP "subscription=paid".

This let you clearly identify in Firebase dashboard or in BigQuery what are the event triggered under which UP. In the dashboard you should use the "Filter" option to filter by UP as explain here.

like image 29
Sistr Avatar answered Oct 19 '22 14:10

Sistr


Since your question refers to creating audiences, you need to be aware that membership in an audience is permanent. In other words, if you have an audience that is defined to be users whose "subscription" user property is "free", once a user is in that audience they will always remain in that audience, even if they make an IAP and their status changes to "paid". The same thing holds for an audience of users whose status is "paid".

like image 2
Dan Morenus Avatar answered Oct 19 '22 14:10

Dan Morenus