Shermeen
Shermeen

Reputation: 303

Creating Graphs with fire base analytics in big query

i am trying to create custom graphs with data i fetched from fire base console via event logging.

1- I found big query and data studio for generating graphs but my requirement is to generate graph auto and update it daily basis.

2- I also want to know about api which will help me to reflect these graphs(generate through big query) on front end web app in Reactjs

SELECT
  *
FROM (
  SELECT
    (
    SELECT
      x.value
    FROM
      UNNEST(user_properties) x
    WHERE
      x.key='restaurantName'
      AND x.value IS NOT NULL ).string_value AS restaurantName,
    event_name AS event,
    (
    SELECT
      x.value
    FROM
      UNNEST(user_properties) x
    WHERE
      x.key='restaurantId'
      AND x.value IS NOT NULL).string_value AS restaurantId,
    event_date AS date,
    (
    SELECT
      x.value
    FROM
      UNNEST(event_params) x
    WHERE
      x.key="allergens"
      AND x.value IS NOT NULL).string_value AS allergens,
    (
    SELECT
      x.value
    FROM
      UNNEST(event_params) x
    WHERE
      x.key="dishes"
      AND x.value IS NOT NULL).string_value AS dishes,
    (
    SELECT
      x.value
    FROM
      UNNEST(event_params) x
    WHERE
      x.key='vegan'
      AND x.value IS NOT NULL).string_value AS vegan,
    (
    SELECT
      x.value
    FROM
      UNNEST(event_params) x
    WHERE
      x.key="vegetarian"
      AND x.value IS NOT NULL).string_value AS vegetarian,
    (
    SELECT
      x.value
    FROM
      UNNEST(event_params) x
    WHERE
      x.key="orderTotal"
      AND x.value IS NOT NULL).string_value AS orderTotal,
    app_info.version AS version
  FROM
    `reference`
  WHERE
    event_name="ConfirmOrderBtn"
    AND app_info.id = "abc"
  ORDER BY
    event_date ASC )

enter image description here

Upvotes: 0

Views: 434

Answers (2)

Federico Taranto
Federico Taranto

Reputation: 132

the refresh rate at the backend depends on the connector you are using. Particularly in this case the BigQuery connector, which has the following Data refresh options:

Every 1 hour

Every 4 hours

Every 12 hours* (default)

An example of refresh time for other connectors, together with further useful information is described at the following link, where in the section "Set data freshness for a data source" you can see an example of freshness options available per connector.

At the frontend, instead, the data coming from the backend is updated in your browser in accordance with the Cache refresh rate. The Cache can be refreshed through the button "Refresh data" button, in the upper right-hand side of the UI. This process can be automated both via browser's console command or via a plugin, as specified in this question.

At the moment I am not aware of any Data Studio API. As I understand the easyness in using datastudio is indeed the exploitation of the ready-made front-end components and data integration tools. Therefore I am not sure I fully understand your question.

Please note that the minimum refresh rate for combined sources is equal to the minimum refresh rate among the sources. Therefore, in your case the data would update each 12 hours, nonetheless at the front end this would be refreshed daily. Also, refreshing data more often triggers more queries execution, needed to update the data, and therefore results in higher billing costs.

Upvotes: 1

Shermeen
Shermeen

Reputation: 303

for me what i am currently following is , have created data source in data studio at this link https://datastudio.google.com/u/2/datasources/createcreate data store

1- connect project to choose your data set 2- Writing custom query for it 3- connect query 4- explore with graph , named it and save 5- Whenever you will visit above mentioned link you will have list of data sources and explorers to visit your graph.We will click refresh icon and it will update it !!

enter image description here

Upvotes: 0

Related Questions