Linkedin Ads

Linkedin Ads to BigQuery

8 min read

Last updated: May 11, 2026

How to Connect LinkedIn Ads to BigQuery: Automated Pipeline, CSV Export, and API

Load LinkedIn Ads data into BigQuery using Estuary, manual CSV export, or custom API scripts. Covers supported streams, BigQuery IAM setup, and OAuth authentication.

Syncing LinkedIn Ads data to Google BigQuery
Share this article
Syncing LinkedIn Ads data to Google BigQuery
Summarize this page with AI

Connecting LinkedIn Ads to BigQuery unlocks campaign performance analysis at scale: cost per lead by audience segment, conversion trends over time, and cross-channel attribution against other ad platforms. This guide covers three methods for getting LinkedIn Ads data into BigQuery, from automated pipelines to manual CSV exports.

⚡Summary: LinkedIn Ads to BigQuery

What data you get: Accounts, account users, campaign groups, campaigns, creatives, ad analytics, ad direct sponsored content, and more — pulled via the LinkedIn Marketing API.

Automated path: Estuary connects to LinkedIn Ads via OAuth and materializes data into BigQuery continuously, without writing code.

Manual path: Export campaign data from LinkedIn Campaign Manager as CSV and upload directly to BigQuery. Simple but requires manual repetition for ongoing reporting.

Custom script path: Use the LinkedIn Ads REST API (adAnalyticsV2) to extract data programmatically and load via the BigQuery API or bq CLI. Most flexible but requires development and maintenance.

What Data Does the LinkedIn Ads to BigQuery Pipeline Capture?

LinkedIn Ads to BigQuery - 3 Methods

Before choosing a method, confirm the data you need is available. Estuary’s LinkedIn Ads connector captures the following resources via the LinkedIn Marketing API:

LinkedIn Ads Resource

Description

Accounts

Ad account details and settings

Account Users

Users with access to each ad account

Campaign Groups

Campaign group structure and budgets

Campaigns

Individual campaign settings, objectives, targeting

Creatives

Ad creative assets and copy

Ad Analytics

Impressions, clicks, spend, conversions by campaign/creative

Ad Direct Sponsored Content

Sponsored content post details

Ad Analytics by Campaign

Performance metrics aggregated at campaign level

Ad Analytics by Creative

Performance metrics aggregated at creative level

For the manual and custom script methods, the available data depends on what LinkedIn Campaign Manager exports or which API endpoints you query. The full LinkedIn Marketing API reference is at docs.microsoft.com/linkedin/marketing.

Method 1: Using ETL Solutions Like Estuary

Estuary connects to LinkedIn Ads via OAuth 2.0, captures data through the LinkedIn Marketing API, and materializes it into BigQuery tables continuously. When LinkedIn Ads data updates, BigQuery reflects the change on the next sync cycle.

When to use: ongoing reporting, dashboards that need fresh data, teams that want a managed pipeline without writing or maintaining code.

Prerequisites

LinkedIn Ads side:

  • A LinkedIn account with access to the ad accounts you want to capture

  • Campaign Manager access at the Account Manager level or above (required for API OAuth authorization)

BigQuery side:

  • A Google Cloud project with the BigQuery API enabled

  • A Google Cloud Service Account with the following IAM roles:

    • roles/bigquery.dataEditor (to write data to datasets)

    • roles/bigquery.jobUser (to run BigQuery jobs)

  • A JSON key file downloaded for the Service Account

If you have not set up a Service Account yet, follow Google’s Service Account creation guide before proceeding.

Step 1: Create the LinkedIn Ads Capture

  • Sign in to your Estuary account (or sign up for free in seconds). Once you’ve logged in, click on Sources.

5 - LinkedIn Ads to BigQuery - Estuary Step
  • Navigate to Sources and click + New Capture

6 - LinkedIn Ads to BigQuery - New Capture
  • On the Captures page, search for LinkedIn Ads and click on Capture.

7 - LinkedIn Ads to BigQuery - Sources
  • Fill in the Capture Details:

    • Name: give the capture a unique name (e.g., linkedin-ads-production)

    • Account IDs: enter the LinkedIn ad account ID(s) you want to capture. Find these in LinkedIn Campaign Manager under Account Assets.

    • Start Date: the earliest date from which to pull historical data (format: YYYY-MM-DD)

8 - LinkedIn Ads to BigQuery - Capture Details
  • Under Authentication, click Sign in with LinkedIn. You will be redirected to LinkedIn to authorize Estuary’s access to your ad account data via OAuth 2.0. After authorizing, you are returned to the Estuary dashboard.

  • Click Next. Estuary connects to the LinkedIn Marketing API and discovers available data resources.

  • Review the discovered collections. Deselect any resources you do not need.

  • Click Save and Publish. The initial backfill begins immediately.

Step 2: Create the BigQuery Materialization

  • After the capture is published, navigate to Destinations and click + New Materialization.

  • Search for BigQuery and click Materialization

9 - LinkedIn Ads to BigQuery - Destinations
  • Fill in the endpoint configuration:

    • Project ID: your Google Cloud project ID

    • Credentials JSON: paste the full contents of your Service Account JSON key file

    • Region: the BigQuery region where your dataset is located (e.g., US, EU, us-central1)

    • Dataset: the BigQuery dataset name where Estuary will create tables (it will create this dataset if it does not exist)

10 - LinkedIn Ads to BigQuery - Materialization Details
  1. Click Next. Estuary maps LinkedIn Ads collections to BigQuery tables automatically.

  2. Review the collection-to-table mapping. Table names match the LinkedIn Ads resource names (e.g., campaigns, ad_analytics).

  3. Click Save and Publish. Estuary loads the initial data, then syncs on an ongoing basis.

Move Data in Minutes - ETL,  ELT, CDC  - Real-time Data Integration

What lands in BigQuery: Each LinkedIn Ads resource becomes a separate BigQuery table in your specified dataset. The ad_analytics table is typically the most used for performance reporting, containing impressions, clicks, spend, and conversion data by campaign and creative.

What Estuary handles that manual methods do not:

  • Automatic schema creation in BigQuery

  • Incremental updates (only new or changed records sync, not full reloads)

  • OAuth token refresh (no manual re-authentication needed)

  • Historical backfill from your specified start date

For more help, see the Estuary documentation for:

Method 2: Manual CSV Export and BigQuery Upload

For one-time analysis or teams with limited LinkedIn Ads data, exporting from Campaign Manager and uploading to BigQuery manually is the simplest path.

When to use: one-off analysis, small datasets, teams that do not need ongoing automated sync.

Limitations: requires manual repetition every time you need fresh data, no real-time updates, prone to human error on large exports.

Step 1: Export LinkedIn Ads Data from Campaign Manager

  1. Log in to LinkedIn Campaign Manager

  2. Navigate to the campaign or account you want to export

  3. Click the Export button in the upper right corner of the reporting view

  4. Select the date range, metrics, and breakdown dimensions

  5. Download the file in CSV format

Step 2: Create a Dataset in BigQuery

  1. Log in to the Google Cloud Console

  2. Navigate to BigQuery

  3. In the Explorer panel, click your project name and select Create Dataset

  4. Give the dataset a name (e.g., linkedin_ads) and select your region

  5. Click Create Dataset

Step 3: Upload the CSV to BigQuery

  1. Click your new dataset in the Explorer panel and select Create Table

  2. Under Source, set Create table from to Upload and browse to your CSV file

  3. Set File format to CSV

  4. Under Destination, confirm the project, dataset, and enter a table name

  5. Under Schema, select Auto-detect to let BigQuery infer column types from the CSV

  6. Under Advanced options, set Header rows to skip to 1 if your CSV has a header row

  7. Click Create Table

4 - LinkedIn Ads to BigQuery - manual method

Step 4: Verify and Query

Once the upload completes, run a basic query to confirm the data loaded correctly:

SELECT *
FROM `your_project.linkedin_ads.your_table`
LIMIT 10;
SELECT *
FROM `your_project.linkedin_ads.your_table`
LIMIT 10;
SELECT *
FROM `your_project.linkedin_ads.your_table`
LIMIT 10;
SELECT *
FROM `your_project.linkedin_ads.your_table`
LIMIT 10;
SELECT *
FROM `your_project.linkedin_ads.your_table`
LIMIT 10;

Check row counts against the Campaign Manager export to confirm nothing was lost during upload.

Method 3: Custom Scripts Using the LinkedIn Ads API and BigQuery API

For teams with specific data transformation requirements or existing data engineering infrastructure, writing a custom pipeline gives the most control.

When to use: complex transformations needed before loading, existing ETL infrastructure, specific data models required.

Limitations: requires development time, ongoing API maintenance when LinkedIn or BigQuery change their APIs, error handling and retry logic must be built manually.

Step 1: Authenticate with the LinkedIn Marketing API

LinkedIn Ads API uses OAuth 2.0. Register an application in the LinkedIn Developer Portal, request the r_ads and r_ads_reporting permissions, and obtain an access token.

Step 2: Extract Data from the LinkedIn Ads API

Use the adAnalyticsV2 endpoint to pull performance metrics:

GET <https://api.linkedin.com/v2/adAnalyticsV2>?
q=statistics
&pivots[0]=CAMPAIGN
&dateRange.start.day=1
&dateRange.start.month=1
&dateRange.start.year=2024
&timeGranularity=DAILY
&campaigns[0]=urn:li:sponsoredCampaign:YOUR_CAMPAIGN_ID
GET <https://api.linkedin.com/v2/adAnalyticsV2>?
q=statistics
&pivots[0]=CAMPAIGN
&dateRange.start.day=1
&dateRange.start.month=1
&dateRange.start.year=2024
&timeGranularity=DAILY
&campaigns[0]=urn:li:sponsoredCampaign:YOUR_CAMPAIGN_ID
GET <https://api.linkedin.com/v2/adAnalyticsV2>?
q=statistics
&pivots[0]=CAMPAIGN
&dateRange.start.day=1
&dateRange.start.month=1
&dateRange.start.year=2024
&timeGranularity=DAILY
&campaigns[0]=urn:li:sponsoredCampaign:YOUR_CAMPAIGN_ID
GET <https://api.linkedin.com/v2/adAnalyticsV2>?
q=statistics
&pivots[0]=CAMPAIGN
&dateRange.start.day=1
&dateRange.start.month=1
&dateRange.start.year=2024
&timeGranularity=DAILY
&campaigns[0]=urn:li:sponsoredCampaign:YOUR_CAMPAIGN_ID
GET <https://api.linkedin.com/v2/adAnalyticsV2>?
q=statistics
&pivots[0]=CAMPAIGN
&dateRange.start.day=1
&dateRange.start.month=1
&dateRange.start.year=2024
&timeGranularity=DAILY
&campaigns[0]=urn:li:sponsoredCampaign:YOUR_CAMPAIGN_ID

Key parameters:

  • pivots: dimension to aggregate by (CAMPAIGN, CREATIVE, MEMBER_COMPANY, etc.)

  • timeGranularity: DAILY, MONTHLY, or ALL

  • dateRange.start / dateRange.end: reporting window

Step 3: Transform and Map to BigQuery Schema

Before loading, map LinkedIn Ads field types to BigQuery types:

LinkedIn Ads Field Type

BigQuery Type

String fields (campaign name, status)

STRING

Integer counts (impressions, clicks)

INTEGER

Float metrics (spend, CTR)

FLOAT

Date fields

DATE

Timestamps

TIMESTAMP

Nested/array fields

RECORD (STRUCT)

Step 4: Load Data into BigQuery

Option A: Via Google Cloud Storage and bq CLI

# Upload transformed data to GCS
gsutil cp linkedin_ads_data.json gs://your-bucket/linkedin/

# Create the BigQuery table and load
bq load \\
  --source_format=NEWLINE_DELIMITED_JSON \\
  --autodetect \\
  your_project:linkedin_ads.ad_analytics \\
  gs://your-bucket/linkedin/linkedin_ads_data.json
# Upload transformed data to GCS
gsutil cp linkedin_ads_data.json gs://your-bucket/linkedin/

# Create the BigQuery table and load
bq load \\
  --source_format=NEWLINE_DELIMITED_JSON \\
  --autodetect \\
  your_project:linkedin_ads.ad_analytics \\
  gs://your-bucket/linkedin/linkedin_ads_data.json
# Upload transformed data to GCS
gsutil cp linkedin_ads_data.json gs://your-bucket/linkedin/

# Create the BigQuery table and load
bq load \\
  --source_format=NEWLINE_DELIMITED_JSON \\
  --autodetect \\
  your_project:linkedin_ads.ad_analytics \\
  gs://your-bucket/linkedin/linkedin_ads_data.json
# Upload transformed data to GCS
gsutil cp linkedin_ads_data.json gs://your-bucket/linkedin/

# Create the BigQuery table and load
bq load \\
  --source_format=NEWLINE_DELIMITED_JSON \\
  --autodetect \\
  your_project:linkedin_ads.ad_analytics \\
  gs://your-bucket/linkedin/linkedin_ads_data.json
# Upload transformed data to GCS
gsutil cp linkedin_ads_data.json gs://your-bucket/linkedin/

# Create the BigQuery table and load
bq load \\
  --source_format=NEWLINE_DELIMITED_JSON \\
  --autodetect \\
  your_project:linkedin_ads.ad_analytics \\
  gs://your-bucket/linkedin/linkedin_ads_data.json

Option B: Direct streaming via BigQuery API (Python)

from google.cloud import bigquery

client = bigquery.Client(project="your_project")
table_id = "your_project.linkedin_ads.ad_analytics"

rows_to_insert = [
    {"campaign_id": "123", "impressions": 1500, "clicks": 45, "spend": 120.50},
    # ... more rows
]

errors = client.insert_rows_json(table_id, rows_to_insert)
if errors:
    print(f"Errors: {errors}")
else:
    print("Data loaded successfully")
from google.cloud import bigquery

client = bigquery.Client(project="your_project")
table_id = "your_project.linkedin_ads.ad_analytics"

rows_to_insert = [
    {"campaign_id": "123", "impressions": 1500, "clicks": 45, "spend": 120.50},
    # ... more rows
]

errors = client.insert_rows_json(table_id, rows_to_insert)
if errors:
    print(f"Errors: {errors}")
else:
    print("Data loaded successfully")
from google.cloud import bigquery

client = bigquery.Client(project="your_project")
table_id = "your_project.linkedin_ads.ad_analytics"

rows_to_insert = [
    {"campaign_id": "123", "impressions": 1500, "clicks": 45, "spend": 120.50},
    # ... more rows
]

errors = client.insert_rows_json(table_id, rows_to_insert)
if errors:
    print(f"Errors: {errors}")
else:
    print("Data loaded successfully")
from google.cloud import bigquery

client = bigquery.Client(project="your_project")
table_id = "your_project.linkedin_ads.ad_analytics"

rows_to_insert = [
    {"campaign_id": "123", "impressions": 1500, "clicks": 45, "spend": 120.50},
    # ... more rows
]

errors = client.insert_rows_json(table_id, rows_to_insert)
if errors:
    print(f"Errors: {errors}")
else:
    print("Data loaded successfully")
from google.cloud import bigquery

client = bigquery.Client(project="your_project")
table_id = "your_project.linkedin_ads.ad_analytics"

rows_to_insert = [
    {"campaign_id": "123", "impressions": 1500, "clicks": 45, "spend": 120.50},
    # ... more rows
]

errors = client.insert_rows_json(table_id, rows_to_insert)
if errors:
    print(f"Errors: {errors}")
else:
    print("Data loaded successfully")

Comparison: All Three Methods

Capability

Estuary

Manual CSV

Custom Scripts

Setup time

Under 15 minutes

Under 30 minutes

Days to weeks

Ongoing maintenance

None (managed)

Manual re-export required

API changes require code updates

Real-time / incremental sync

Yes

No

Depends on implementation

Historical backfill

Yes (from start date)

Limited to Campaign Manager export range

Yes, if coded

Schema creation in BigQuery

Automatic

Manual or auto-detect

Manual

OAuth token management

Automatic

N/A

Manual refresh logic required

Technical skill required

None

None

Python/SQL + API knowledge

Cost

Estuary free tier available

Free

Engineering time

Best for

Ongoing reporting and dashboards

One-time analysis

Custom data models

Final Thoughts

For teams running ongoing LinkedIn Ads campaigns and reporting in BigQuery, Estuary’s automated pipeline eliminates the manual export-upload cycle and keeps data current without engineering overhead. For one-off analysis, the manual CSV method is the fastest path. For teams with specific schema requirements or existing data infrastructure, the custom API approach gives the most control at the cost of development time.

Start your free Estuary pipeline or explore related guides:

START STREAMING YOUR DATA FOR FREE

START STREAMING YOUR DATA FOR FREE

About the author

Jeffrey is a data engineering professional with over 15 years of experience, helping early-stage data companies scale by combining technical expertise with growth-focused strategies. His writing shares practical insights on data systems and efficient scaling.

Real-Time & Batch Pipelines.

Real-Time & Batch Pipelines.

Real-Time & Batch Pipelines.

Simple to Deploy.

Simple to Deploy.

Simple to Deploy.

Simply Priced.

Simply Priced.

Simply Priced.

$0.50/GB of data moved + $100/month per connector instance

$0.50/GB of data moved + $100/month per connector instance

$0.50/GB of data moved + $100/month per connector instance

Simple usage-based pricing with volume discounts

Simple usage-based pricing with volume discounts

Simple usage-based pricing with volume discounts

Sub-100ms end-to-end latency for real-time pipelines

Sub-100ms end-to-end latency for real-time pipelines

Sub-100ms end-to-end latency for real-time pipelines

Estuary logo - Real-time data integration platform

Log-based CDC, SaaS, and batch unified in an event-driven ETL architecture.

Don’t miss a thing

Subscribe now to get the latest news and updates.

© 2026 All Rights Reserved -

Estuary

Slack
GitHub
LinkedIn
X