This documentation outlines the setup and usage of Jitsu, BigQuery and Firebase in your project. It is intended for developers, data analysts, or researchers who want to collect, store, and process application analytics or event data.
Jitsu is an open-source data ingestion platform that collects events from your app and sends them to data warehouses like BigQuery. It acts as a pipeline, ensuring that your analytics data flows in real time to your chosen storage.
Google BigQuery is a fully-managed cloud data warehouse by Google. It is designed for fast SQL queries and analysis of large datasets. In this integration, BigQuery will store and make queryable the raw events received via Jitsu.
Firebase is a backend-as-a-service platform from Google. It provides tools like authentication, Firestore database, hosting, Remote Config, and serverless functions. In this integration, Firebase is used to store user and survey configuration data, and to manage application settings.
- Your app sends analytics events to Jitsu via its JavaScript SDK.
- Jitsu forwards those events to BigQuery (and potentially other destinations).
- BigQuery stores those events in structured datasets for analysis.
- Firebase provides application configuration, storage, and user-related data that can complement your event analytics in BigQuery.
In this setup, Jitsu will collect app events and store them in BigQuery for analysis.
- Go to https://elest.io and sign in or create an account.
- Create a new project.
- Select Jitsu as the service during project setup.
- Provide any necessary configuration parameters (e.g., project name, region, authentication).
- Once deployed, you’ll get access to the Jitsu web interface.
- Open the Jitsu dashboard from your Elestio deployment.
- Go to Overview and click Add Destination.
- Choose BigQuery as the destination type.
- Fill in the required fields:
- Project ID – your Google Cloud project ID
- Dataset Name – the BigQuery dataset where events will be stored
- GCP Credentials – upload or paste your Service Account JSON key
- Save the destination configuration.
- In the Jitsu dashboard, go to Overview and click Add Source.
- Choose JavaScript SDK (Browser) or other appropriate type.
- Jitsu will generate a Write Key for this source.
- Copy the Write Key and Ingest URL – you’ll need them for SDK integration.
-
Install the package:
npm install @jitsu/js
-
Import and configure the service in your project:
import { jitsuAnalytics } from "@jitsu/js"; import { JITSU_WRITE_KEY, JITSU_INGEST_URL } from "../config"; this.client = jitsuAnalytics({ writeKey: JITSU_WRITE_KEY, host: JITSU_INGEST_URL, });
Use the following example method to track events:
async track<T>(event: string, properties: T): Promise<void> {
return new Promise((resolve, reject) => {
this.client.track(
{ event, properties },
(error, data) => (error ? reject(error) : resolve(data))
);
});
}In this setup, BigQuery is the main destination where Jitsu sends event data for storage and querying.
- Go to Google Cloud Platform and log in or create an account.
- Navigate to the GCP dashboard.
- Click on
Select a projectorCreate Project. - Choose your organization and name the project, then click
Create.
Once the project is created, you can:
- Access and manage various GCP services.
- Assign resources to this project.
- From the GCP dashboard, navigate to
Cloud Storagethen toBucketsby searching for it in the search bar or finding it in the menu.
In the Buckets UI, you need:
- Create bucket to store data before loading into BigQuery(it's for RudderStack configuration)
- From the GCP dashboard, navigate to
BigQueryby searching for it in the search bar or finding it in the menu.
In the BigQuery UI, you can:
- View your data and query results.
- Manage datasets and tables.
- From the GCP dashboard, navigate to
APIs & Servicesthen toCredentialsby searching for it in the search bar or finding it in the menu.
In the Credentials UI, you need:
- Click on the
Create Credentialsbutton and selectService Account. - After account created, go to the
Keystab and click onAdd keybutton. - After key added, you will retrieve a json file, the contents of which must be entered in the Credentials field when configuring on RudderStack.
- From the GCP dashboard, navigate to
IAM & Adminby searching for it in the search bar or finding it in the menu.
In the IAM UI, you need:
- Find and select the created Service Account.
- Ensure it has the following roles:
BigQuery Job User,BigQuery Data Owner,Storage Object Creator,Storage Object Viewer. - If any role is missing, click Edit and add the required roles.
In this integration, Firebase is used for:
- Storing user data (via Firestore)
- Managing survey configurations (via Remote Config)
- Hosting functions for app logic
- Log in to Firebase Console or create an account if you don’t have one.
- Create a new Firebase project.
To manage your Firebase project settings:
- Navigate to
Project Settingsby clicking the gear icon in the top left corner.
- Go to Firestore Database in your Firebase dashboard.
- Click on
Create Databaseand follow the prompts to set up your Firestore database. - Configure database rules for security and access control.
Firestore Database will be used to store user data.
- Navigate to Remote Config in the Firebase console.
- Click on
Create Configurationand define parameters for surveys and other settings you need.
Remote Config will be used to store survey configurations.
- Navigate to Functions in your Firebase dashboard.
- Create a new function that triggers your authentication flow (e.g., sign-in). This function can be hosted on Google Cloud Run for scalability.
Example Firebase Function (TypeScript):
import * as functions from 'firebase-functions';
import * as admin from 'firebase-admin';
admin.initializeApp();
export const signInTrigger = functions.https.onRequest((req, res) => {
// Your sign-in logic here
res.send('Sign-in triggered');
});To connect your application to Firebase, you need the following environment variables:
- FIREBASE_API_KEY.
- FIREBASE_PROJECT_ID.
- FIREBASE_MESSAGING_SENDER_ID.
- FIREBASE_APP_ID.
All of these values you can find in Project Settings.
To integrate Firebase with your project, install the Firebase SDK:
npm install firebaseCreate a firebaseConfig.ts file and add the following code:
import { initializeApp } from 'firebase/app';
import { getFirestore } from 'firebase/firestore';
const firebaseConfig = {
apiKey: "Your api key",
authDomain: "Your auth domain",
projectId: "Your project id",
storageBucket: "Your storage bucket",
messagingSenderId: "Your messaging sender id",
appId: "Your app id",
};
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);
export { db };import { getValue } from 'firebase/remote-config';
async function fetchSurveyConfig() {
const surveyParam = await getValue(remoteConfig, 'survey_config');
console.log('Survey Config:', surveyParam.asString());
}
fetchSurveyConfig();