Home getting-started Connect BigQuery with Service Account

Connect BigQuery with Service Account

Last updated on Mar 31, 2026

How to Connect Google BigQuery with Service Account

This guide shows you how to connect BigQuery to Ranksy using our service account. This method is simpler than OAuth - you just grant access to our service account in your Google Cloud project.

What You'll Get

Once connected, Ranksy imports your GA4 data and shows:

  • Traffic Sources: Where visitors come from
  • Pageviews: How many people view your app listing
  • Sessions: Complete user journeys
  • Geographic Data: User locations
  • Device Data: Mobile vs desktop traffic
  • Click Events: User interactions
  • Conversion Tracking: From view to install
  • Attribution: Which channels drive customers

Prerequisites

Before you start, make sure you have:

  • Google Analytics 4 (GA4) tracking your Shopify app
  • GA4 linked to BigQuery with data export enabled
  • At least 24 hours of exported data in BigQuery
  • Access to Google Cloud Console for your project

Don't have BigQuery export set up yet? See our Set Up GA4 BigQuery Export guide first.


Step 1: Grant Access to Ranksy Service Account in Google Cloud IAM

In this step, you'll add the Ranksy service account to your Google Cloud project and give it permission to read your BigQuery data.

Video Tutorial

Written Instructions

1.1 Open Google Cloud Console

  1. Go to console.cloud.google.com
  2. Make sure you're signed into the Google account that owns the BigQuery project
  3. Select your project from the dropdown at the top of the page

1.2 Navigate to IAM & Admin

  1. Click the hamburger menu (☰) in the top left
  2. Scroll down and click IAM & Admin
  3. Click IAM in the submenu

1.3 Add the Ranksy Service Account

  1. Click the + GRANT ACCESS button at the top
  2. In the "New principals" field, enter the Ranksy service account email:
[email protected]
  1. Click in the "Select a role" dropdown

1.4 Assign Required Roles

You need to add two roles to the service account:

First Role - BigQuery Data Viewer:

  1. In the role dropdown, type "BigQuery Data Viewer"
  2. Select BigQuery Data Viewer from the list

Second Role - BigQuery Job User:

  1. Click + ADD ANOTHER ROLE
  2. Type "BigQuery Job User"
  3. Select BigQuery Job User from the list

1.5 Save the Configuration

  1. Review your settings:
  2. Click SAVE

You should see the Ranksy service account appear in your IAM members list.

Why These Roles?

Role Purpose
BigQuery Data Viewer Allows reading data from your BigQuery tables
BigQuery Job User Allows running queries against your data

These are read-only permissions. Ranksy cannot modify, delete, or write to your BigQuery data.


Step 2: Connect BigQuery in Ranksy

Now that you've granted access, enter your project details in Ranksy to complete the connection.

Video Tutorial

Written Instructions

2.1 Navigate to App Settings

  1. Log into Ranksy
  2. Click on your profile/name in the bottom left of the sidebar
  3. Click Manage Apps from the dropdown menu
  4. Click on your app's row to open its settings page

2.2 Find the BigQuery Section

Scroll down to the Google BigQuery integration card.

2.3 Enter Your Project Details

Google Cloud Project ID:

  1. This is your Google Cloud project identifier
  2. Find it in Google Cloud Console at the top of the page (e.g., my-company-analytics)
  3. Enter it in the "Google Cloud Project ID" field

BigQuery Dataset ID:

  1. This is where GA4 exports your data
  2. The format is analytics_XXXXXXXXX where X's are your GA4 property ID
  3. Enter it in the "BigQuery Dataset ID" field

Example configuration:

  • Project ID: my-company-analytics
  • Dataset ID: analytics_123456789

2.4 Save and Import

  1. Click Save Configuration & Import Data
  2. Ranksy will:
    • Validate the connection
    • Start importing your historical data
    • Show a success message

Finding Your Dataset ID

If you're not sure what your dataset ID is:

  1. Go to console.cloud.google.com
  2. Navigate to BigQuery (in the sidebar or search for it)
  3. In the left panel, expand your project
  4. Look for a dataset named analytics_XXXXXXXXX
  5. The dataset name is your Dataset ID

What Happens After Connection

Initial Import

After saving your configuration:

  • Ranksy begins importing your historical GA4 data
  • Import duration depends on data volume (typically 15-60 minutes)
  • You can close the page - import continues in the background

Automatic Updates

Once connected, Ranksy automatically:

  • Daily: Imports new data each morning
  • Every 4 hours: Checks for intraday updates
  • No manual action required!

View Your Data

After import completes, explore your data:

  • Traffic Analytics: See where your visitors come from
  • Attribution: Understand which channels drive installs
  • Analytics Dashboard: Get a complete overview

Troubleshooting

Error: "Access denied" or "Permission denied"

The service account doesn't have access to your project.

Fix:

  1. Go back to Google Cloud Console → IAM & Admin → IAM
  2. Verify the Ranksy service account is listed
  3. Check it has both BigQuery Data Viewer and BigQuery Job User roles
  4. If missing, click the pencil icon to edit and add the missing role

Error: "Dataset not found"

The dataset ID is incorrect or doesn't exist.

Fix:

  1. Go to BigQuery in Google Cloud Console
  2. Verify the dataset analytics_XXXXXXXXX exists
  3. Copy the exact dataset name and paste it in Ranksy
  4. Make sure there are no typos or extra spaces

Error: "Project not found"

The project ID is incorrect.

Fix:

  1. Go to Google Cloud Console
  2. Look at the project selector at the top - copy the project ID (not the name)
  3. Enter the exact project ID in Ranksy

Import Takes Too Long

Large datasets can take time to import.

What to expect:

  • 7 days of data: 15-30 minutes
  • 30 days of data: 30-60 minutes
  • 1 year of data: 2-4 hours

If import hasn't completed after 6 hours, contact support.

No Data Shows After Import

Check these:

  1. Verify GA4 is actually tracking your app (check Google Analytics)
  2. Confirm BigQuery export has data (check tables in BigQuery console)
  3. Make sure you selected the correct date range in Ranksy

Security & Privacy

What We Access

Ranksy only reads your GA4 event data from BigQuery. We cannot:

  • Modify your data
  • Delete tables or datasets
  • Access other Google services
  • See data from other projects

Data Handling

  • All data is encrypted in transit (TLS/SSL)
  • Stored encrypted at rest (AES-256)
  • Isolated per account
  • GDPR compliant

FAQ

Q: Why use service account instead of OAuth? A: Service account is simpler - no login popups, no token expiration, more reliable long-term connection.

Q: Can multiple team members use this? A: Yes! Once the service account has access, any team member in Ranksy can view the data.

Q: What if I remove the service account later? A: Ranksy will no longer be able to import new data, but existing imported data remains.

Q: Does this cost money? A: BigQuery has a free tier (1 TB queries/month, 10 GB storage). Most apps stay within free limits.

Q: Can I use both OAuth and service account? A: No, you use one or the other. Service account is recommended for most users.


Next Steps

Now that BigQuery is connected:


Need help? Contact [email protected] or use the chat widget. Include your app name and any error messages you see.