---
title: "How to Connect LinkedIn Ads to Databricks: Setup and SQL"
canonical: "https://www.owox.com/blog/articles/how-to-connect-linkedin-ads-to-databricks"
updated: "2026-10-05"
---

# How to connect LinkedIn Ads to Databricks, step by step

To connect LinkedIn Ads to Databricks, create a connector Data Mart on a Databricks storage, sign in with LinkedIn, enter the ad account, choose the Ad Analytics endpoint and name the catalog, schema and table. The analytics table identifies rows by URNs, not names, so load the Campaigns endpoint as a second Data Mart and join the two. The SQL is in this guide.

[Databricks](/blog/topics/databricks) · Updated October 1, 2026 · [Ievgen Krasovytskyi](/team/ievgen-krasovytskyi) · 8 min read

![How to connect LinkedIn Ads to Databricks, step by step](https://cdn.owox.com/www/webflow/6a2186bd41f892a2b2a9055d_LinkedIn-Ads-to-Databricks.png/public)

For most B2B teams LinkedIn is the most expensive click in the plan, and the hardest to connect to an outcome. Campaign Manager reports clicks and leads. Whether a lead became pipeline is recorded somewhere else, and the two meet in a spreadsheet.

A table in Databricks is where they can meet properly. This guide loads LinkedIn Ads data into Databricks with the LinkedIn Ads connector in [OWOX Data Marts](https://www.owox.com/app-signup). It follows the five setup screens, then deals with the detail most guides leave out: the analytics table that arrives has no campaign names in it.

## What you end up with

Two Delta tables in your own Databricks workspace.

*   `linkedin_ads_ad_analytics`: daily performance. Impressions, clicks, cost and engagement for each creative on each day.
*   `linkedin_ads_ad_campaigns`: one row per campaign, with its name, status, objective and type.

Each is its own connector Data Mart. The connector reads the LinkedIn API, writes the tables and refreshes them on a schedule. It does not model the data. Joining the two into a report is SQL you write, shown below.

## Before you start

### In LinkedIn

A LinkedIn user with access to the ad account in Campaign Manager, and the account’s ID, which Campaign Manager shows next to the account name.

### In Databricks

A storage of type [Databricks](/data-storages/databricks) connected to your OWOX Data Marts project. The [storage guide](https://docs.owox.com/docs/storages/supported-storages/databricks/) asks for the workspace **host**, the **HTTP path** of a SQL warehouse and a **personal access token**. The token’s user needs permission to create schemas and tables in the catalog you choose, and to run queries on that warehouse.

The SQL warehouse behind the HTTP path does the work, so it sets the cost. Turn on auto stop and start small. [Databricks pricing](/blog/articles/databricks-pricing) shows what a short daily job is billed for.

## The Turning Point

OWOX Data Marts

See your first report built in real time. _15 minutes._

1.  Connect your data warehouse
2.  Pick your metrics
3.  Get a live Google Sheets report

In the time it takes to write a ticket. Then imagine never writing that ticket again.

[Book a Demo](/book-a-call)

We'll use your actual use case

## Step 1: create the Data Mart and choose the connector

Click **New Data Mart**, give it a title, pick the Databricks storage and click **Create Data Mart**. On the Data Setup tab, set **Definition Type** to **Connector**.

![Set Up Connector dialog in OWOX Data Marts, step 1 of 5, with LinkedIn Ads selected in a list that also shows Facebook Ads, Google Ads, LinkedIn Pages, Microsoft Ads, Reddit Ads, Shopify and TikTok Ads – every source is set up through the same five screens](https://cdn.owox.com/www/webflow/6a216f346c3cd88985e85b11_5dc6f0d5.png/public)

Choose **LinkedIn Ads** and click **Next**.

## Step 2: sign in and enter the account

![Set Up Connector dialog in OWOX Data Marts, step 2 of 5, for LinkedIn Ads with a Continue with LinkedIn button, a Manually link and a required Account URNs field – one sign-in and the account ID connect the source](https://cdn.owox.com/www/webflow/6a216f346c3cd88985e85b1b_26d01a71.png/public)

**Continue with LinkedIn** is the short way: sign in as the user who has access to the ad account and allow access.

**Manually** means creating your own LinkedIn app. The app has to be verified by an administrator of your company page and approved for the Advertising API, which can take up to a day. From it you take a client ID, a primary client secret and a refresh token generated with the `r_ads` and `r_ads_reporting` scopes. The [credentials guide](https://docs.owox.com/packages/connectors/src/sources/linked-in-ads/credentials/) has each step. The sign-in button avoids all of it.

Then fill in **Account URNs** with the ID of the ad account.

## Step 3: choose the endpoint

**Each Data Mart loads one endpoint.** LinkedIn Ads has five.

![Set Up Connector dialog in OWOX Data Marts, step 3 of 5, listing LinkedIn Ads endpoints with a description each: Ad Accounts, Campaign Groups, Campaigns, Creatives and Ad Analytics – performance and campaign settings are separate endpoints](https://cdn.owox.com/www/webflow/6a216f346c3cd88985e85b18_50c86bf5.png/public)

*   **Ad Analytics.** Daily performance metrics. The one for reporting.
*   **Campaigns.** Targeting, format, bid strategy, budget and, most usefully, the campaign name.
*   **Campaign Groups.** The level above campaigns, with shared objectives and budgets.
*   **Creatives.** The ads themselves.
*   **Ad Accounts.** Account settings, currency and status.

Create the Ad Analytics Data Mart first and the Campaigns one right after it. You will want both.

## Step 4: choose the fields

Ad Analytics offers a long list, most of it engagement detail.

![Set Up Connector dialog in OWOX Data Marts, step 4 of 5, with LinkedIn Ad Analytics fields: dateRangeEnd and pivotValues locked as keys, and actionClicks, adUnitClicks, clicks, comments and costInLocalCurrency ticked – a row is identified by its date and its pivot values, not by a campaign name](https://cdn.owox.com/www/webflow/6a216f346c3cd88985e85b14_7435ad63.png/public)

Take impressions, clicks, `costInUsd` and the conversion or lead fields you report on. For accounts billed in another currency there is also `costInLocalCurrency`. Fields can be added later, and the connector adds the columns.

## Step 5: name the catalog, schema and table

On Databricks the destination has three levels.

![Set Up Connector dialog in OWOX Data Marts, step 5 of 5, with Catalog name set to main, Schema name linkedin\_ads\_owox and Table name linkedin\_ads\_ad\_analytics, each noted as created on first run if it does not exist – the destination is a three-level Unity Catalog name](https://cdn.owox.com/www/webflow/6a216f346c3cd88985e85b0d_7f454a9a.png/public)

The setup proposes the catalog `main`, a schema named after the source and a table named after the endpoint. Each is created on the first run if it does not exist. Use the same schema for the Campaigns Data Mart, so the two tables sit together.

Click **Save**, then **Publish & Run Data Mart**. Publishing starts the first import.

![Data Setup tab of a published LinkedIn Ads connector Data Mart in OWOX Data Marts, showing the LinkedInAds source with the adAnalytics endpoint and the Databricks catalog, schema and table it writes to – the data is in your workspace](https://cdn.owox.com/www/webflow/6a216f346c3cd88985e85b0a_b2ac16b5.png/public)

## Load history and set the schedule

### Backfill

Click **Manual Run** and choose **Backfill (custom period)**. One backfill run covers at most 31 days. For a longer history, run consecutive periods, each after the previous one has finished.

![Manual Run panel in OWOX Data Marts with Backfill (custom period) selected, start and end date fields and a note that a backfill run can cover at most 31 days – history is loaded one month at a time](https://cdn.owox.com/www/content-marketing-article/how-to-connect-linkedin-ads-to-databricks/screens/1.png/public)

### Schedule

A Data Mart without a trigger does not run again. On the **Triggers** tab, add a trigger of type **Connector Run**: daily, weekly, monthly or at an interval.

![Create Scheduled Trigger form in OWOX Data Marts on the LinkedIn Ads Data Mart, with trigger type Connector Run, a daily schedule at 09:00 and a time zone – the load repeats without anyone starting it](https://cdn.owox.com/www/webflow/6a216f346c3cd88985e85b22_97655562.png/public)

Scheduled runs are incremental. Each one loads the current day plus the days set by the **Reimport Lookback Window**, two by default. LinkedIn conversions can be attributed days after the click, so raise the lookback if your reports depend on them. Rows are merged on the keys, so a re-imported day replaces the earlier version.

### If a run ends with a warning

LinkedIn’s analytics endpoint returns at most 15,000 rows per request and has no paging. The connector requests one day at a time to stay under that limit. An account with more than 15,000 active creatives on a single day can still exceed it. The run then finishes with a Warning status and lists the affected days, and data for those days may be incomplete.

## What the tables look like in Databricks

**The identifiers are in `pivotValues`.** The connector requests analytics by creative, campaign, campaign group and account at once. LinkedIn returns those four identifiers as URNs, and they arrive together in one text column, in a form like this:

```
urn:li:sponsoredCreative:…, urn:li:sponsoredCampaign:…,
urn:li:sponsoredCampaignGroup:…, urn:li:sponsoredAccount:…
```

There is no `campaign_name` column in this table. You extract the campaign ID from `pivotValues` and join to the Campaigns table for the name.

**A three-level name, no quoting.** With the proposed names the table is `main.linkedin_ads_owox.linkedin_ads_ad_analytics`. Column names keep LinkedIn’s camel case, `dateRangeStart`, `costInUsd`, but Databricks does not treat names as case-sensitive, so they need no quotes.

**The day is `dateRangeStart`**, a date column. With daily data, `dateRangeStart` and `dateRangeEnd` are the same day. Metrics are numeric.

**Keys and comments in the catalog.** The connector declares the keys as the table’s primary key and writes each field’s description as a column comment, so the long field list is documented in Catalog Explorer.

## Query the data

Both queries were validated on a Databricks SQL warehouse against an analytics table loaded by the connector, in a shared schema called `ads_owox`. The join was checked with a stand-in for the Campaigns table.

Cost, clicks and cost per click by campaign ID and day, for the last 30 days:

```
SELECT
  dateRangeStart AS date,
  regexp_extract(
    pivotValues, 'sponsoredCampaign:([0-9]+)', 1
  ) AS campaign_id,
  SUM(impressions) AS impressions,
  SUM(clicks) AS clicks,
  SUM(costInUsd) AS cost_usd,
  SUM(costInUsd) / NULLIF(SUM(clicks), 0) AS cpc
FROM main.ads_owox.linkedin_ads_ad_analytics
WHERE dateRangeStart >= date_sub(current_date(), 30)
GROUP BY 1, 2
ORDER BY date, cost_usd DESC;
```

`regexp_extract` with group 1 returns the digits after `sponsoredCampaign:`. Swap in `sponsoredCreative` or `sponsoredCampaignGroup` to report at another level.

The same report with campaign names, joined to the Campaigns table:

```
WITH a AS (
  SELECT
    dateRangeStart AS date,
    regexp_extract(
      pivotValues, 'sponsoredCampaign:([0-9]+)', 1
    ) AS campaign_id,
    impressions,
    clicks,
    costInUsd
  FROM main.ads_owox.linkedin_ads_ad_analytics
)
SELECT
  a.date,
  c.name AS campaign,
  SUM(a.impressions) AS impressions,
  SUM(a.clicks) AS clicks,
  SUM(a.costInUsd) AS cost_usd
FROM a
LEFT JOIN main.ads_owox.linkedin_ads_ad_campaigns c
  ON a.campaign_id = c.id
GROUP BY a.date, c.name
ORDER BY a.date, cost_usd DESC;
```

This second query is the one worth publishing. Save it as a SQL Data Mart, and the people who read the report see campaign names and never meet a URN.

## From table to report

On a Data Mart’s **Destinations** tab you attach reports to Google Sheets, Data Studio, Slack or email, each with its own columns and schedule. Do that on the Data Mart built from the joined query, not on the raw analytics table. [Databricks to Google Sheets](/blog/articles/databricks-to-google-sheets) walks through the scheduled report and the self-service route for business users.

Two directions from here matter for B2B.

**LinkedIn next to the other channels.** One row per day and channel, with LinkedIn’s `costInUsd` mapped to the same spend column as the rest. Each platform is a connector Data Mart of its own, and a `UNION ALL` over them is the unified table.

**LinkedIn next to pipeline.** If CRM data is in Databricks, the join key is whatever your campaigns write into the lead: a UTM campaign value or the campaign ID. Decide that convention first. The SQL is the easy part.

## Where to go next

The same five screens load the other sources into the same workspace: [Google Ads](/blog/articles/connect-google-ads-to-databricks), [Facebook Ads](/blog/articles/connect-facebook-ads-to-databricks) and [TikTok Ads](/blog/articles/how-to-connect-tiktok-ads-to-databricks).

On Snowflake the steps are the same and the naming rules differ: see [LinkedIn Ads to Snowflake](/blog/articles/linkedin-ads-to-snowflake). For the platform itself, start with [what Databricks is and how it works](/blog/articles/what-is-databricks).

## Your New Normal

Turn your data into decisions.

Governed data marts give you the clean foundation ML needs to actually work.

*   No AI hallucinations
*   Analyst-governed definitions
*   Every number traces to SQL

[Get started free](https://www.owox.com/app-signup)

## FAQ

## Frequently Asked Questions

How often does the connector load LinkedIn Ads data into Databricks?

As often as the Connector Run trigger you set: daily, weekly, monthly or at an interval. Each scheduled run is incremental and loads the current day plus the days in the Reimport Lookback Window, two by default. Raise the lookback if you report on conversions that LinkedIn attributes several days after the click.

Is the OWOX LinkedIn Ads connector open source?

Yes. The connectors are part of the OWOX Data Marts repository on GitHub, and the connectors package is published under the MIT licence. You can read how the LinkedIn Ads connector requests analytics and how it writes to Databricks.

How do I get campaign names for LinkedIn Ads data in Databricks?

The analytics table identifies rows by URNs stored in the pivotValues column. Extract the campaign ID with regexp\_extract(pivotValues, 'sponsoredCampaign:(\[0-9\]+)', 1) and join it to the id column of the table loaded from the Campaigns endpoint, which holds the name. Publish that joined query as a SQL Data Mart so reports show names.

What LinkedIn Ads data can I import into Databricks?

Ad Analytics gives daily performance per creative: impressions, clicks, cost in USD and in local currency, and engagement and conversion fields. Campaigns, Campaign Groups, Creatives and Ad Accounts hold names, statuses, objectives and settings. Each endpoint is loaded by its own Data Mart into its own table.

Can I connect LinkedIn Ads to Databricks without writing code?

Yes. In OWOX Data Marts you create a Data Mart on a Databricks storage, set its definition type to Connector, choose LinkedIn Ads, sign in with LinkedIn and pick the endpoint, the fields and the catalog, schema and table. The connector creates the table and loads it. SQL only comes in afterwards, when you query the table.

## Who wrote this

![Ievgen Krasovytskyi](https://cdn.owox.com/www/webflow/68404586b341508a789a4aa5_.png/public)

[Ievgen Krasovytskyi](/team/ievgen-krasovytskyi) · Head of Marketing

Ievgen Krasovytskyi is the Head of Marketing at OWOX, leading strategy across content, SEO, product marketing, and AI-powered automation. With deep expertise in analytics infrastructure, data warehouses, and marketing technology, he builds systems that connect marketing performance to business outcomes. Ievgen writes about SaaS growth, analytics workflows, and the future of AI in marketing operations.

[LinkedIn](https://www.linkedin.com/in/ievgen-krasovytskyi-a38a1253/) · [All articles](/team/ievgen-krasovytskyi)

[Databricks](/blog/topics/databricks)

## Related articles

[Databricks · How to Connect Facebook Ads to Databricks, Step by Step · October 1, 2026](/blog/articles/connect-facebook-ads-to-databricks)

[Databricks · How to Connect Google Ads to Databricks, Step by Step · October 1, 2026](/blog/articles/connect-google-ads-to-databricks)

[Databricks · Databricks Pricing Explained: DBU Rates, Compute Types and What Drives Your Bill · October 1, 2026](/blog/articles/databricks-pricing)

[See all articles →](/blog/articles)

## Book a call

You are booked. The invitation is on its way to , with the calendar invite and the meeting link.

[Reschedule](#)

[Cancel](#)

## Links

Pages this page links to, on this site and on docs.owox.com. Where the page has a Markdown twin, its address follows the link.

- [Databricks](https://www.owox.com/blog/topics/databricks) — /blog/topics/databricks.md
- [Ievgen Krasovytskyi](https://www.owox.com/team/ievgen-krasovytskyi) — /team/ievgen-krasovytskyi.md
- [OWOX Data Marts](https://www.owox.com/app-signup)
- [Databricks](https://www.owox.com/data-storages/databricks) — /data-storages/databricks.md
- [storage guide](https://docs.owox.com/docs/storages/supported-storages/databricks)
- [Databricks pricing](https://www.owox.com/blog/articles/databricks-pricing) — /blog/articles/databricks-pricing.md
- [Book a Demo](https://www.owox.com/book-a-call) — /book-a-call.md
- [credentials guide](https://docs.owox.com/packages/connectors/src/sources/linked-in-ads/credentials)
- [Databricks to Google Sheets](https://www.owox.com/blog/articles/databricks-to-google-sheets) — /blog/articles/databricks-to-google-sheets.md
- [Google Ads](https://www.owox.com/blog/articles/connect-google-ads-to-databricks) — /blog/articles/connect-google-ads-to-databricks.md
- [Facebook Ads](https://www.owox.com/blog/articles/connect-facebook-ads-to-databricks) — /blog/articles/connect-facebook-ads-to-databricks.md
- [TikTok Ads](https://www.owox.com/blog/articles/how-to-connect-tiktok-ads-to-databricks) — /blog/articles/how-to-connect-tiktok-ads-to-databricks.md
- [LinkedIn Ads to Snowflake](https://www.owox.com/blog/articles/linkedin-ads-to-snowflake) — /blog/articles/linkedin-ads-to-snowflake.md
- [what Databricks is and how it works](https://www.owox.com/blog/articles/what-is-databricks) — /blog/articles/what-is-databricks.md
- [See all articles →](https://www.owox.com/blog/articles) — /blog/articles.md
