How to automatically insert data annually? - firebase

I have an insurance-like app where members have to pay annual due. How to automatically insert annual due to all members so that I can track members who have Unpaid, Pending, and Paid annual dues? I have tried comparing the year of the last annual due payment and the current year so that if the member opens my app and my app detects that current year > last annual due payment, a new annual due will be inserted to that member with the status of Unpaid. My problem is that what if the user set the current year to be always equal to the current year?

I have an insurance-like app where members have to pay annual due. How to automatically insert annual due to all members so that I can track members who have Unpaid, Pending, and Paid annual dues?
The best option that you have, is to use Cloud Scheduler, which allows you to schedule HTTP requests or Cloud Pub/Sub messages to Cloud Functions that you deploy. So basically you need to create functions that will automatically insert annual due to all members. To logic inside these functions should be created according to your needs.

Related

Discrepancy between Engagement Time Msec Firebase Dashboard Vs BigQuery Data

I use BigQuery to get data from Firebase, and I'm having some issues with data accuracy. Figures I get from the data in BigQuery are not matching the ones on Firebase dashboard.
I recently understood that Firebase does not look at all users, instead it considers only active users. So now I have filtered for active users by putting a filter for engagement_time_msec>0. My active users number is matching up with Firebase dashboard now (just 1-2 digits difference occassionally).
But my main problem is with the average engagement time!
Firebase (and GA for Firebase) shows average engagement time metric under engagement overview. When you hover over it, it gives this definition.
"Average Engagement Time per active user for the time period selected"
However, when I get data through BigQuery and calculate this manually, my numbers are off.
I am calculating Active Users as Distinctcount of user_psuedo_ID where engagement time>0, and engagement time is being summed up where event name = user_engagement. (I have converted engagement time msec to mins)
Average engagement time = SUM(Engagement time mins)/Active Users
This should give me an average engagement time per active user, but this figure doesn't match the one in Firebase console. I have tried so many methods, and I fail to understand what Firebase is doing at the back end to come up with these values.
P.s: I have also tried summing up engagement time without a condition on event name and that gives me an even greater average, making the difference between it and Firebase even bigger.
Please help!!

Create a trial account for new users to test a web app build with Firebase: How should I count a trial period?

Product: Web App.
Technologies: Firebase, JavaScript, Cloud Functions.
Hello I am dealing with the task of creating a trial account for new users in order of testing an app to know if it fits theirs requirements.Then, within trial time, users can decide if they want to suscribe or not.
This is my initial idea:
A potential new user discovers the landing page of the app
The user is interested in the app and creates a new account
The new account has a trial period (15 days free)
Whithin this trial period the user has to subscribe (Stripe) or the account is disabled/removed
I know that Stripe can deal with trial periods, but you first have to fill the payment data (credit card, etc). I want to avoid this, so I want to control the trial time and let the user try the app without asking him for payment data.
My cuestion is that after creating the user account, in which way could I count the trial period ?
Do I have to use Cloud Functions to count the trial period? Any orientation about how to count the trial period with Cloud Functions? Do I have to check the new accounts every day or something like that or is there any other way to get a notice after the trial period is over?
Any other approches?
Thanks!
My cuestion is that after creating the user account, in which way could I count the trial period ?
When the user creates an account, store a timestamp of creation date for your document. When the user logs in, check if this timeStamp has passed 15 days or not.
You can also capture the time of creating the account in your app, add to it 15 days in the future, and then save this new [expiry date] in your user account info document.
Whenever this user logs in, first check, if the expiry date is before\after the current date. If it's after the current date(time of login), do your logic and tell them that the trial period is over.

GA report API v4, I want to update data every minute. How to update data if there is no identifier?

I have some criteria for the report and I want to add them to postresql and update for example every minute.Should i have to call reporting api for the current day and overwrite all the data for the current day?
calling reporting API every second for today's data has a little sense since Analytics data processing lag is 24-48 hours and most probably your data won't be updated with 1-sec frequency.
Also, the only convenient way to export data to own storage from API is scheduled calling reporting API for a dynamically generated date range (like last seven days) and overwriting the existing data in the storage.
You might add ga:date to your reported dimensions to get your report data date-wise so you'll be able to track what needs to be updated.

Incorrect refund import by transactionId in Google Analytics

I have an issue with the refunds import through standard Property menu "data import". I use refund import only by ga:transactionId.
As i have read in help in this case there is no need to supply any additional information about transaction (sku, quantity, revenue, etc.).
Whole transaction will be refunded.
In fact i see in report Sales Performance that all refunds are linked with correct transactionId, but have different date, source / medium, etc.
For me it seems to be absolutely random attribution (except date may be, it's date of import)
For example, one transactionId.
Originally it happened at June, 28 in yamarket / cpc. And refund is linked to June, 30 and webvisor.com / referral. Date of refunds common for all transactions and it is date of import (today). Source / medium is absolutely random.
May be i need to wait one day, but i doubt that.
And due to different dates if i choose date range that does not include both dates i will receive only refund or only transaction payment.
Does system work correct?
If system works correct, can i unload all refunds back?
All work as it supposed to be. While it is strange logic for my opinion.
Google will change help content to cover this topics.
Refunds are always linked to date of import, not to date of initial transaction.
And, unexpectedly for me, to the last session of buyer on the moment of import. So this session does not necessarily coincide with the purchase session if buyer visited site after transaction.
That's why i get different source/medium for refund and transaction.

signalR group notification + Design pattern

I have an app which ties members to their respective groups the moment they complete registeration. e.g Payroll staffs --> Payroll group, Helpdesk staffs --> Helpdesk group. I want to make use of signalR to cater for their notification requirements so whenever Payroll staffs does something significant that requires to notify the rest, it publishes a message and only those inside the Payroll group will receive the notification.
A staff is not restricted to only one group but unlimited no. of groups depending on the company requirements.
I am not exactly sure how to go about this but what I can think of is when the moment a staff signs in, my app gets data from the db, maybe a string of concatened groups and does a loop to 'subscribes' to all the groups they belong to and after that store that group infomation data from the db in a session variable and use it as a subscription list everytime the user changes page so that they can receive notifications throughout their session on the app.
Anyone has got any suggestion to handle my situation better? Thanks.

Resources