
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?
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.
- Navigate to Sources and click + New Capture
- On the Captures page, search for LinkedIn Ads and click on Capture.
- 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)
- Name: give the capture a unique name (e.g.,
- 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
- 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)
- Click Next. Estuary maps LinkedIn Ads collections to BigQuery tables automatically.
- Review the collection-to-table mapping. Table names match the LinkedIn Ads resource names (e.g.,
campaigns,ad_analytics). - Click Save and Publish. Estuary loads the initial data, then syncs on an ongoing basis.
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
- Log in to LinkedIn Campaign Manager
- Navigate to the campaign or account you want to export
- Click the Export button in the upper right corner of the reporting view
- Select the date range, metrics, and breakdown dimensions
- Download the file in CSV format
Step 2: Create a Dataset in BigQuery
- Log in to the Google Cloud Console
- Navigate to BigQuery
- In the Explorer panel, click your project name and select Create Dataset
- Give the dataset a name (e.g.,
linkedin_ads) and select your region - Click Create Dataset
Step 3: Upload the CSV to BigQuery
- Click your new dataset in the Explorer panel and select Create Table
- Under Source, set Create table from to Upload and browse to your CSV file
- Set File format to CSV
- Under Destination, confirm the project, dataset, and enter a table name
- Under Schema, select Auto-detect to let BigQuery infer column types from the CSV
- Under Advanced options, set Header rows to skip to
1if your CSV has a header row - Click Create Table
Step 4: Verify and Query
Once the upload completes, run a basic query to confirm the data loaded correctly:
sqlSELECT *
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:
plaintextGET <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, orALLdateRange.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
bash# 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)
pythonfrom 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:

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.













