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
- Go to console.cloud.google.com
- Make sure you're signed into the Google account that owns the BigQuery project
- Select your project from the dropdown at the top of the page
1.2 Navigate to IAM & Admin
- Click the hamburger menu (☰) in the top left
- Scroll down and click IAM & Admin
- Click IAM in the submenu
1.3 Add the Ranksy Service Account
- Click the + GRANT ACCESS button at the top
- In the "New principals" field, enter the Ranksy service account email:
[email protected]
- 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:
- In the role dropdown, type "BigQuery Data Viewer"
- Select BigQuery Data Viewer from the list
Second Role - BigQuery Job User:
- Click + ADD ANOTHER ROLE
- Type "BigQuery Job User"
- Select BigQuery Job User from the list
1.5 Save the Configuration
- Review your settings:
- Principal:
[email protected] - Roles: BigQuery Data Viewer, BigQuery Job User
- Principal:
- 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
- Log into Ranksy
- Click on your profile/name in the bottom left of the sidebar
- Click Manage Apps from the dropdown menu
- 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:
- This is your Google Cloud project identifier
- Find it in Google Cloud Console at the top of the page (e.g.,
my-company-analytics) - Enter it in the "Google Cloud Project ID" field
BigQuery Dataset ID:
- This is where GA4 exports your data
- The format is
analytics_XXXXXXXXXwhere X's are your GA4 property ID - Enter it in the "BigQuery Dataset ID" field
Example configuration:
- Project ID:
my-company-analytics - Dataset ID:
analytics_123456789
2.4 Save and Import
- Click Save Configuration & Import Data
- 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:
- Go to console.cloud.google.com
- Navigate to BigQuery (in the sidebar or search for it)
- In the left panel, expand your project
- Look for a dataset named
analytics_XXXXXXXXX - 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:
- Go back to Google Cloud Console → IAM & Admin → IAM
- Verify the Ranksy service account is listed
- Check it has both BigQuery Data Viewer and BigQuery Job User roles
- 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:
- Go to BigQuery in Google Cloud Console
- Verify the dataset
analytics_XXXXXXXXXexists - Copy the exact dataset name and paste it in Ranksy
- Make sure there are no typos or extra spaces
Error: "Project not found"
The project ID is incorrect.
Fix:
- Go to Google Cloud Console
- Look at the project selector at the top - copy the project ID (not the name)
- 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:
- Verify GA4 is actually tracking your app (check Google Analytics)
- Confirm BigQuery export has data (check tables in BigQuery console)
- 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:
- View Traffic Analytics - See where your visitors come from
- Explore Attribution - Understand your customer journey
- Check Analytics Dashboard - Get the full picture
Need help? Contact [email protected] or use the chat widget. Include your app name and any error messages you see.