Automate Google Firebase Analytics Data Export - firebase

After a solid load of searching I'm still not able to find a way to automate the export of Google Firebase Analytics data.
I need to import a few KPIs in an existing Google Sheet every month.
Isn't there any option to query the Firebase API through the Google Sheet and GET the KPI I need into a cell somehow every month?
There are ways (and even plugins) to do that for Google Analytics data. So I was sure it should be possible for firebase aswell.

To import Firebase analytics data into a Google Spreadsheet, you'll need to go through BigQuery. There's a Google Spreadsheet add-on called OWOX but I couldn't get it to work, so here's how to do it via creating a Google Apps Script:
In Firebase under Project settings (under the gear icon) -> Account Linking : find the BigQuery tile and sign up if you haven't already. This DOES require moving to the Blaze pay-as-you-go plan, but there's a generous amount of free usage in this tier so you're likely to avoid costs, but you do need to provide the usual billing info.
After signing up for Blaze, you'll go back under this Account Linking section and you'll see that BigQuery is now linked to your apps. Click on "Manage Linking" and you'll likely see "Syncing dataset" for awhile... like several hours (note, this page doesn't seem to refresh on its own so you'll have to refresh manually to check status). Once this is complete, you'll be able to access your data via BigQuery on the Google Spreadsheets side.
In your Google Spreadsheet, select Tools -> Script Editor. There's a good starter script here: https://greenido.wordpress.com/2013/12/16/big-query-and-google-spreadsheet-intergration/
In Google Script editor, select Resources -> Advanced Google services and ensure you turn on BigQuery API. Now your script will have access to BigQuery data.
For my needs, I was just trying to get a count of some events in Firebase, so I wrote a function to invoke multiple queries like this:
function runQueries() {
var sql;
// fetch bigQuery data for Firebase app Create Wildlink (bottom row app)
sql = "#standardSQL\nSELECT count(event_dim) as event_count FROM `PROJECTID.TABLENAME.app_events_*`, UNNEST(event_dim) as event WHERE event.name = 'target_event_name'";
runQuery(sql, 1, 1, 'Label 1');
// fetch bigQuery data for Firebase app Share Extension (top row app)
sql = "#standardSQL\nSELECT count(event_dim) as event_count FROM `PROJECTID.TABLENAME.app_events_*`, UNNEST(event_dim) as event WHERE event.name = 'target_event_name_2'";
runQuery(sql, 3, 1, 'Label 2');
Browser.msgBox("Finished updating the results");
}
And then I changed the runQuery function to accept and use those params:
function runQuery(sql, insertRow, insertCol, label) {
...
sheet.getRange(insertRow, insertCol + 1, resultCount, tableRows[0].getF().length).setValues(resultValues);
sheet.getRange(insertRow, insertCol).setValue(label);
A few important notes about this method:
Events don't appear to be imported retroactively. From the moment you tie Firebase to BigQuery you start getting event data, but it doesn't import any old data.
Events are imported into day-parted tables. Note in the example above the wildcard in the table reference to span tables.
The example above uses StandardSQL (which was new to me). Note the #standardSQL\n in the above SQL strings. That changes from the default mode (LegacySQL). I ran into challenges using legacy SQL to get at the data.

Let me help you to deal with the OWOX BI BigQuery Add-on and simplify steps 3 to 6 from the answer above.
First of all, you really need to link BigQuery to your apps (Ian wrote good instruction how to do that in steps 1 and 2).
Then:
Add OWOX BI BigQuery Reports Add-on to your Chrome browser,
Open your Google Sheet, run add-on (Add-ons -> OWOX BI BigQuery Reports -> Add a new report),
Provide the add-on with the access to your BQ tables,
Select your Google BigQuery project in a drop-down list,
And create a new query (once again, Ian provide you with a good example of the query)
You can find some more details about OWOX BI BigQuery add-on in our Help Center. And feel free to write to us via email (bi#owox.com) or in chat - we’ll be happy to answer any of your questions.
Best regards, Eugene

Related

Firebase A/B test user variant information not available in Google Analytics clickstream tables

I'm looking to report on the outcome of a Firebase A/B test using Google Analytics / BigQuery tables.
To do this I need to identify the test group each user was in.
The Firebase documentation (https://firebase.google.com/docs/ab-testing/ab-concepts) suggests experiment and variant memberships are stored as user properties on every GA event in the normal GA event tables.
However, I can't find this information associated with GA events in the GA interface or BQ clickstream tables - I can only see it in the Firebase tables.
Where should I be looking? I've checked the Event Action, Event Category, Event Label etc. dimensions.
Use in your query to identify it
userProperty.value.string_value where userProperty.key = 'firebase_exp_000'

get CTR or clicks/Impressions via sisense from google analytics

I have CTR, clicks in the Google analytics. I want to get these data via sisense. According to the instruction https://documentation.sisense.com/7-1/managing-data/connectors/google-analytics.htm#gsc.tab=0 I use elastiCube manager to create an ElastiCube. I use google analitics web service to add the data to ElasiCube. I got 27 tables with names like: Traffic By Navigation, Monthly Report, Traffic By Navigation, Monthly Report and so on. By they do not have the fields which I need. I go to google analitics account via Behavior->Events->Overview. I can see "Clicks". How can I get it via sisense?
Here you can find an example for adding event fields with XML: https://support.sisense.com/hc/en-us/community/posts/115007407787-Tracking-Sisense-Usage-Via-Google-Analytics

Session information missing from exported firebase data to Big Query

I seem to be missing session related information to the events that gets exported from Firebase to Big Query. More specifically, a unique identifier of each session (ga_session_id) and an ordinal number of the session count specific to the user that generates the events (ga_session_number).
All though they are not part of the export schema, they can be found in the documentation elsewhere and a recent blog post showing queries where they use these missing fields.
Do I have to enable something in order for them to start showing up in the event_params of my firebase analytics events or are these things not yet implemented? If not, is there any information on when this will happen?
edit: I'm using the Firebase Unity SDK.
Thanks in advance!
With this query I get the expected results:
SELECT event_params.value.int_value AS session_id
FROM `your table`, UNNEST (event_params) AS event_params
WHERE event_params.key = "ga_session_id"
GROUP BY 1
Note that in the blogpost query-example they use event_params.value.string_value which does not give any results
You also need to have the right SDK version (update from December)

Interpreting Google BigQuery "rows" - Firebase Events

I have used Firebase Analytics for logging user events in my app. Having got data of quite a lot of distinct users, I'm having a hard time understanding what an individual row means in the app_events table for a respective day.Is this row a session of user-events from activity onStart() to activity onStop() ? For a same userId, I'm getting multiple rows with different events in them.
Also, are the user-properties defined in the user-dimensions mutable or immutable i.e. as in, set values once, and can't over-write any further?
All help is appreciated.
The BigQuery Export Schema can be found in Help Center, and it states that :
Each row within a table corresponds to a bundle of events uploaded by
the Firebase Analytics SDK.
User Properties are mutable. However, we generally recommend that you use User Properties for static or slow-changing attributes to maximize their value in report-filtering.
each row in bigquery table of firebase events export should represent single firebase event.
source - google help> [GA4] BigQuery Export schema

Importing off-line conversion data in to Google Analytics - can'[t select metrics?

I'm trying to import data in to analytics. When I select the "User Data type" it allows me to set user ID as the key, but then I can't select any metrics? Screen here
http://content.screencast.com/users/KJPH/folders/Jing/media/b0905e94-7e2f-49a4-8c63-5cbacb8f22cb/2015-05-15_0836.png
You need to first create user scoped custom dimensions. See this complete example of how to import user data into Google Analytics.

Resources