Best practice for setting up analytics

Data in BigQuery typically resides in tables. When you are sharing data with Toplyne, the best practice is to create separate tables for event data and profile data partitioned on atime column .

Event data table

This table will capture an action a user/account (entity) takes; it will help answer the question, “what has a user/account done on your product”.


Each row in this table represents an event triggered by an entity.


  • ACCOUNTID/USER_ID (Required)_: Key to identify which entity has performed the event
  • EVENTNAME (Required)_: Name of the event
  • TIMESTAMP (Required)_: Timestamp at which the event has occurred
  • EVENTPROPERTIES (Optional)_: Event properties, typically shared as a JSON
    with key/value pairs

Sample Event Table

Profile data table

This table will capture any profile information a user/account (entity) has; it will help answer the question, “who is this entity?”.


Each row in this table is a unique entity.


  • ACCOUNTID/USER_ID (Required)_: Key to identify which entities' properties are listed in the row.
  • Each subsequent column is a profile key, and against it, you will have its value. For example, you may choose to include the email address, geographical location, account name, current billing plan they are on, etc.

Sample User Table

Sample Account Table

Step-by-step guide to share

  1. Login into your Google Cloud Platform account.

  2. Go to IAM & Admin -> Click on Roles

  1. Click on Create Role
  1. Add Title As Toplyne Session Read role and ID as Toplye_Session_Read_role -> click on Add Permissions
  1. Search for BigQuery Read Session User > Click Ok
  1. Select all the supported roles and click ADD
  1. Click on Create to create the role
  1. Go To IAM & Admin -> Select Service Accounts
  1. Click on Create a Service Account
  1. Enter the Name ToplyneServiceAccount and Service account Id toplyneserviceaccount -> Click on Create and Continue
  1. Add BigQuery Job User role and Toplyne Session read role that we have created in Step 4
  1. Go to BigQuery and select your dataset.
  1. Navigate to Sharing -> click on Permissions
  1. Add Principal -> Enter service account email address you created in Step 10 -> Grant BigQuery Data Editor, Data Owner and Data Viewer Access -> Click Save
  1. Go back to IAM and select Service Accounts
  1. Select the service account that you have created in Step 10
  1. Go to Keys tab -> Add keys -> Create new key
  1. Download the key and share with us