How to Format and Save a View of Elevar Event Data in BigQuery
Overview
Once your Elevar events are successfully streaming into your BigQuery table, you now officially own this data. However, by default, the raw data can look a bit messy and are often structured in JSON objects, which can make writing SQL queries difficult. To make your data easier to work with, you can create a cleaned-up view of your table that formats the event data into simple, user-friendly rows and columns.
Important Note: BigQuery Costs
It is important that you understand that BigQuery is a great tool for the insights that it can provide, but it is not free. Querying, storing, and streaming data into BigQuery can cause significant costs, especially as your data volume grows.
Elevar is not responsible for any costs associated with your Google Cloud usage, including BigQuery storage, streaming, or queries.
We highly recommend that you review Google's BigQuery pricing documentation to understand how costs are calculated.
Recommended Best Practices:
- Partition your Data: Without partitioning, all of your event data is stored in a single and massive table. This leads to higher query costs and slower performance, especially as your dataset grows. Partitioning your BigQuery tables (e.g., by date) significantly improves query efficiency and can help dramatically reduce costs over time.
Clean Up the Table View
Copy Your Full Table Path:
- In BigQuery, navigate to the dataset and table that is streaming your Elevar events.
- Open the query editor by clicking on the three dots next to your table name and selecting Query.
- Copy your full table path (this includes your project ID, dataset name, and table name) from the query window.
- (See Figure 1)
_Figure 1_
Clear and Replace the Existing Query:
- Delete the current query text from the window and paste the predefined query block that you previously copied into the window.
- Navigate to the bottom of the query and replace the bottom line of the query with your copied table path (your project, dataset, and table name).
- (See Figure 2)
_Figure 2_
Run the Query:
- Once you have entered the query, click the "Run" button located in the top menu.
- When the query finishes, you will see a cleaned-up version of your event data.
- (See Figure 3)
_Figure 3_
Note: Data in the Raw Payload
The cleaned up view is a simplified representation of the event data and does not include every field available in the raw payload.
If you are interested in accessing additional metadata or nested values (e.g., full product objects, custom event parameters, user traits), we recommend exploring the original JSON structure to understand how your data is organized and what’s available for advanced querying.
Save the View for Future Use
Once you have the clean view ready, you can save it permanently in your system so you don’t have to recreate the query each time.
Save the View:
- Click the "Save" dropdown arrow located in the top menu.
- From the dropdown menu, click on the "Save View" button.
- (See Figure 4)
_Figure 4_
Save View:
- An additional window titled "Save View" will appear.
- Navigate to the text box titled "Project" and select the project name.
- Navigate to the text box titled "Dataset" and select the dataset you are working in.
- Navigate to the text box titled "Table Name" and enter a memorable name for your view (e.g., elevar_event_data)
- After completing the form, click the Save button located in the bottom right-hand corner of the window.
- (See Figure 5)
_Figure 5_
Updated about 12 hours ago