Back to Guides
    getting startedbeginner5 minutesNov 18, 2024

    Connecting BigQuery to Cogny in 5 Minutes

    Connect your BigQuery data warehouse to Cogny for advanced analytics and AI-powered insights. Quick 5-minute setup guide with step-by-step instructions.

    Connecting BigQuery to Cogny in 5 Minutes

    TL;DR

    Connect your BigQuery data warehouse to Cogny in 5 minutes for advanced analytics and AI-powered insights on your complete marketing data.

    What you'll accomplish:

    • Create a BigQuery service account with proper permissions
    • Generate and copy the JSON authentication key
    • Connect BigQuery project to Cogny platform
    • Enable AI analysis on raw, unsampled data warehouse queries

    Time required: 5 minutes | Difficulty: Beginner | Prerequisites: Google Cloud project with BigQuery enabled, Owner or Editor role

    Quick Start: Navigate to Google Cloud Console → IAM & Admin → Service Accounts → Create Service Account → Grant "BigQuery Data Viewer" role → Create JSON key.


    Related Resources

    Essential guides for making the most of your BigQuery connection:


    Question

    How do I connect my Google BigQuery data warehouse to Cogny?

    Answer

    Create a service account in Google Cloud Console. Grant BigQuery Data Viewer permissions. Copy the JSON key and paste it into Cogny.

    Done.

    Quick Tip: If you haven't used BigQuery before, start by connecting Google Ads or Meta Ads first through their native integrations. Once you're comfortable with Cogny, come back to BigQuery for advanced multi-source analysis and custom queries.

    Why BigQuery?

    BigQuery is where your real data lives.

    Not aggregated metrics from ad platforms. Not sampled GA4 data. Your complete, raw customer journey.

    Every click. Every purchase. Every touchpoint.

    That's the goldmine Cogny's AI needs to find real insights.

    Most teams use BigQuery for GA4 data exports, which gives unsampled event-level analytics far beyond what the GA4 interface provides.

    What You'll Get

    After this 5-minute setup:

    • Direct access to your complete data warehouse
    • AI analysis on raw, unsampled data
    • Custom queries across all your data sources
    • No export limits or API throttling

    Analysis depth: 100x deeper than platform APIs Data freshness: Real-time (as fresh as your BigQuery)

    Note: BigQuery is a powerful data warehouse, but it requires a Google Cloud account and technical setup. If you're just getting started with Cogny, we recommend beginning with direct Google Ads or Meta Ads connections. Return to BigQuery when you need custom queries, GA4 export analysis, or multi-source data modeling.


    Prerequisites

    Before you start, you need:

    1. Google Cloud project with BigQuery enabled
    2. Owner or Editor role on the project (to create service accounts)
    3. At least one dataset in BigQuery (even if empty)

    Don't have BigQuery yet? Google offers $300 free credits. Perfect for getting started.


    Step 1: Open Google Cloud Console

    Go to console.cloud.google.com

    Select your project.

    If you don't see your project in the dropdown:

    1. Click the project selector at the top
    2. Find the right organization
    3. Select the project with your BigQuery data

    Time: 30 seconds


    Step 2: Create Service Account

    Navigate to: IAM & Admin → Service Accounts

    Click + CREATE SERVICE ACCOUNT

    Fill in:

    • Service account name: cogny-integration
    • Description: Service account for Cogny AI analytics platform

    Click CREATE AND CONTINUE

    Time: 1 minute


    Step 3: Grant Permissions

    You'll see "Grant this service account access to project"

    Add these roles:

    1. BigQuery Data Viewer
    2. BigQuery Job User

    That's it.

    These roles let Cogny:

    • Read your data (Data Viewer)
    • Run queries on your behalf (Job User)
    • But NOT modify or delete anything

    Security note: Read-only access. Cogny cannot change your data. Ever.

    Click CONTINUE, then DONE

    Time: 1 minute


    Step 4: Create JSON Key

    Find your new service account in the list.

    Click the three dots (⋮) on the right.

    Select Manage keys

    Click ADD KEY → Create new key

    Choose format: JSON

    Click CREATE

    A JSON file downloads to your computer.

    Security warning: This file is sensitive. Don't share it publicly. Don't commit it to GitHub. Treat it like a password.

    Time: 1 minute


    Step 5: Add to Cogny

    Log into Cogny.

    Go to your warehouse.

    Click Add Data Source

    Select BigQuery

    You'll see a text field labeled "Service Account JSON"

    Open the JSON file you just downloaded.

    Copy the entire contents.

    Paste into Cogny.

    Click Connect

    Time: 1 minute

    Cogny validates the connection. If successful, you'll see a green checkmark.


    Step 6: Select Datasets

    Cogny shows all datasets in your BigQuery project.

    Select which datasets to analyze:

    • ✅ Production analytics data
    • ✅ Marketing spend data
    • ✅ Customer data
    • ❌ Test/development datasets (skip these)

    Click Save Selection

    Cogny starts analyzing.

    Time: 30 seconds


    What Happens Next

    Immediate (1-2 minutes):

    • Cogny catalogs your tables and schemas
    • AI identifies data types and relationships
    • You can start building reports

    Within 24 hours:

    • First AI-generated growth tickets appear
    • Pattern analysis across your entire dataset
    • Recommendations based on complete customer journey

    Ongoing:

    • Real-time analysis as new data arrives
    • Automatic anomaly detection
    • Continuous optimization suggestions

    Common Issues

    "Permission denied" error

    You need Owner or Editor role to create service accounts. Ask your Google Cloud admin to either:

    1. Grant you the role, or
    2. Create the service account for you

    "Dataset not found"

    Your service account needs access to the dataset. In BigQuery, go to dataset → SHARING → ADD PRINCIPAL Add your service account email Grant "BigQuery Data Viewer" role

    "Invalid JSON key"

    Make sure you copied the ENTIRE file contents. Starting with { Ending with } No extra spaces or line breaks

    "No datasets found"

    Your BigQuery project might be empty. Or the service account doesn't have the right permissions. Double-check the BigQuery Data Viewer role is applied.


    Security Best Practices

    1. Use dedicated service account Don't reuse service accounts from other tools. Create a new one specifically for Cogny.

    2. Minimal permissions Only grant BigQuery Data Viewer and Job User. Never grant Editor or Owner roles.

    3. Rotate keys annually Create a new JSON key once a year. Delete the old one.

    4. Monitor usage Check BigQuery audit logs periodically. Verify queries are legitimate.

    5. Separate environments Use different service accounts for:

    • Production data
    • Staging/development data Never mix them.

    What's Next

    Your BigQuery is connected. Data is flowing. AI is analyzing.

    Next steps:

    1. Connect GA4 → Add Google Analytics data to BigQuery
    2. Connect Google Ads → Merge ad spend with conversion data
    3. Build first report → See AI insights in action
    4. Review growth tickets → Get your first recommendations

    Recommended guides:


    Next Steps

    After connecting BigQuery to Cogny, maximize your data warehouse investment:

    Immediate Actions:

    1. Set up GA4 BigQuery export to get unsampled event-level analytics
    2. Connect Google Ads to merge ad spend with conversion data
    3. Explore the schema catalog in Cogny to understand your data structure

    Advanced Use Cases:

    Optimization Tips:

    • Use partitioned queries to control BigQuery costs
    • Set up scheduled syncs during off-peak hours
    • Monitor query performance in Cogny's analytics dashboard

    Need help? We can assist with:


    Need Help?

    Can't create service accounts?

    We can walk you through it live. Schedule a demo and we'll do the setup together.

    Want us to audit your BigQuery setup?

    We'll check:

    • Data structure optimization
    • Query performance
    • Cost efficiency
    • Security configuration

    Book a call: https://calendar.app.google/y1vjieT3P1h7GLL36


    FAQ

    Q: Does Cogny store my BigQuery data?

    No.

    Cogny queries your BigQuery directly. Results are cached temporarily for performance. No raw data is permanently stored outside your Google Cloud.

    Q: Will this increase my BigQuery costs?

    Minimally.

    Cogny optimizes queries to minimize data scanned. Most customers see <$10/month increase. The insights usually save 50-100x that in ad spend.

    Q: Can I revoke access anytime?

    Yes.

    Delete the service account in Google Cloud Console. Or delete the JSON key. Cogny loses access immediately.

    Q: What if my data changes?

    Cogny automatically detects schema changes. New tables appear in the catalog. New columns are analyzed. No manual updates needed.

    Q: Can I use multiple BigQuery projects?

    Yes.

    Create a service account in each project. Add each to Cogny separately. AI analyzes across all projects.

    Q: Is my data secure?

    Yes.

    • Service account uses read-only permissions
    • JSON keys encrypted at rest
    • TLS encryption in transit
    • SOC 2 compliant infrastructure
    • No data sharing with third parties

    About This Guide

    Written by the Cogny team—built by the founders who created AI optimization systems for Netflix, Zalando, and Momondo at Campanja, and scaled growth for Kry, Epidemic Sound, and Yubico through GrowthHackers.se.

    We've connected hundreds of BigQuery warehouses. This is the fastest, safest way to do it.

    Last Updated: November 18, 2024

    Ready to Get Started?

    See Cogny in Action

    Schedule a demo to see how AI can transform your marketing analytics and automate your growth optimization.

    Schedule Demo