# Marketing analytics - Docs

**Beta feature**

This feature is currently an opt-in beta. You can enable it on the [feature previews settings page](https://app.posthog.com/settings/user-feature-previews#marketing-analytics). Please leave a comment on this page if you have feedback or questions, or leave feedback via the in-app support modal.

**Marketing analytics** enables you to track marketing campaigns, costs, and performance from multiple advertising platforms in your [marketing analytics dashboard](https://app.posthog.com/web/marketing).

**Column definitions**

For detailed column definitions, formulas, and platform field mappings, see [Column definitions](/docs/web-analytics/marketing-analytics-schema.md).

## Getting started

When you first visit the [marketing analytics dashboard](https://app.posthog.com/web/marketing), you'll see a guided onboarding wizard that walks you through setup:

1.  **Welcome** – Introduction to Marketing Analytics and its capabilities
2.  **Add source** – Connect your marketing data sources (native integrations, data warehouse, or self-managed sources)
3.  **Conversion goals** – Define what actions count as conversions (optional)

You can skip the conversion goals step and configure them later in [settings](https://app.posthog.com/settings/environment-marketing-analytics). Once you complete onboarding, you'll see the full marketing dashboard with your campaign data.

## Marketing dashboard

The marketing dashboard contains multiple pre-built insights that help you understand your campaigns and costs.

### Marketing costs over time

![Marketing analytics dashboard showing marketing costs over time](https://res.cloudinary.com/dmukukwp6/image/upload/chart_white_e4dddd2635.png)![Marketing analytics dashboard showing marketing costs over time](https://res.cloudinary.com/dmukukwp6/image/upload/chart_dark_b615545f58.png)

The marketing costs chart displays your total advertising spend across all configured data sources:

-   **Stacked area visualization** shows the contribution of each platform to your total marketing spend
-   **Time-based trends** help identify spending patterns and budget allocation over the selected date range
-   **Date range filtering** allows you to analyze costs for specific periods using the date picker
-   **Real-time updates** reflect new cost data as it syncs from your configured marketing sources (based on your source sync configuration)
-   **Currency conversion** automatically converts all monetary values (costs and conversion values) to your configured base currency for consistent reporting

### Campaign breakdown

![Campaign costs breakdown table showing detailed performance metrics](https://res.cloudinary.com/dmukukwp6/image/upload/table_white_e64873d2b0.png)![Campaign costs breakdown table showing detailed performance metrics](https://res.cloudinary.com/dmukukwp6/image/upload/table_dark_9c7ba9afdb.png)

The campaign breakdown table provides detailed performance metrics by individual campaign:

-   **Campaign**: Campaign identifier from your advertising platform (must match the `utm_campaign` value in your conversion events)
-   **Source**: Ad platform name (e.g., `google`, must match the `utm_source` value in your conversion events)
-   **Total cost**: Total spend for the campaign in your base currency
-   **Total clicks**: Number of clicks received during the selected period
-   **Total impressions**: Number of impressions served
-   **Cost per click**: Average cost per click (total cost ÷ total clicks)
-   **CTR**: Click-through rate percentage (total clicks ÷ total impressions × 100)
-   **Cost per reported conversion**: Average cost for each conversion reported by the ad platform (total cost ÷ reported conversions)
-   **Conversion goals**: Performance against your defined conversion goals
-   **Cost per conversion**: Cost efficiency for conversions (total cost ÷ conversions)

## Settings and configuration

### Data source configuration

![Unified data source configuration showing native, data warehouse, and self-managed sources](https://res.cloudinary.com/dmukukwp6/image/upload/w_800,c_limit,q_auto,f_auto/Screenshot_2025_10_24_at_11_32_53_AM_11adfeb6c8.png)![Unified data source configuration showing native, data warehouse, and self-managed sources](https://res.cloudinary.com/dmukukwp6/image/upload/w_800,c_limit,q_auto,f_auto/Screenshot_2025_10_24_at_11_32_23_AM_00e27030df.png)

PostHog supports three types of data sources for marketing analytics. All sources are configured through a unified interface that shows the connection status, required table syncing, and column mapping for each source type.

**No data sources configured**

If you haven't configured any data sources, you'll see an error banner prompting you to add at least one native integration or connect a data warehouse source.

#### Native sources

PostHog can automatically sync marketing data from supported advertising platforms. You'll need to sync the required tables for each source to enable the functionality.

**Supported native sources:**

| Platform | Setup Guide | Required Tables |
| --- | --- | --- |
| Google Ads | [Setup guide](/docs/cdp/sources/google-ads.md) | campaign and campaign_overview_stats |
| LinkedIn Ads | [Setup guide](/docs/cdp/sources/linkedin-ads.md) | campaign_groups and campaign_group_stats |
| Meta Ads | [Setup guide](/docs/cdp/sources/meta-ads.md) | campaigns and campaign_stats |
| Pinterest Ads | [Setup guide](/docs/cdp/sources/pinterest-ads.md) | campaigns and campaign_analytics |
| TikTok Ads | [Setup guide](/docs/cdp/sources/tiktok-ads.md) | campaigns and campaign_report |
| Reddit Ads | [Setup guide](/docs/cdp/sources/reddit-ads.md) | campaigns and campaign_report |
| Bing Ads | [Setup guide](/docs/cdp/sources/bing-ads.md) | campaigns and campaign_performance_report |
| Snapchat Ads | [Setup guide](/docs/cdp/sources/snapchat-ads.md) | campaigns and campaign_stats_daily |

Each native source automatically handles data formatting and provides the required campaign and performance data. The configuration interface shows which tables are syncing and which still need to be enabled.

#### Data Warehouse sources

You can *optionally* connect external Data Warehouse sources (currently BigQuery) to display Marketing Analytics. You'll need to map the required columns for each table to enable the functionality.

**Required field mappings:**

-   **Campaign**: Campaign identifier or name (mapped to `utm_campaign` query param)
-   **Cost**: Cost amount for the period
-   **Date**: Date of the data record
-   **Source**: Platform name (mapped to `utm_source` query param)

**Optional field mappings:**

-   **Clicks**: Number of clicks received
-   **Currency**: Currency code for cost values
-   **Impressions**: Number of impressions served

#### Self-managed sources

You can configure self-managed sources from S3, GCS, Cloudflare R2, and Azure. Like Data Warehouse sources, you'll need to map the required columns for each table to enable the functionality.

**Recommended format**

We strongly recommend using JSON format for better support and troubleshooting. Create a connection between PostHog and your marketing source, map the desired fields, and PostHog will use the marketing data directly from that source.

Please refer to the [data pipeline docs](/docs/cdp/sources.md) for more information on configuring external data sources.

### Conversion goals

![Conversion goals configuration](https://res.cloudinary.com/dmukukwp6/image/upload/cg_white_fa41a57c55.png)![Conversion goals configuration](https://res.cloudinary.com/dmukukwp6/image/upload/cg_dark_c6d0c0e1a1.png)

Define conversion goals by selecting events, actions, or Data Warehouse tables. These goals are used to track and analyze user conversions in your Marketing Analytics.

To configure conversion goals, select:

| Configuration Field | Description |
| --- | --- |
| Conversion goal name | Descriptive name (e.g., purchase, sign up, download) |
| Event, action or Data Warehouse table | Select what to track for conversions |
| Schema mapping | For Data Warehouse tables, map campaign and source attribution fields. For events, PostHog uses UTM parameters: utm_campaign and utm_source |

For Data Warehouse table conversion goals, you'll need to map the following required fields:

| Required Field | Description |
| --- | --- |
| UTM Campaign Name | Maps to the utm_campaign parameter for attribution |
| UTM Source Name | Maps to the utm_source parameter for attribution |
| Timestamp Field | Date/time field for the conversion event |
| Distinct ID Field (optional) | User identifier for conversion tracking |

### Advanced settings

![Advanced settings to map campaign data from your advertising sources to your conversion events](https://res.cloudinary.com/dmukukwp6/image/upload/Screenshot_2025_12_09_at_3_16_20_PM_60589e9810.png)![Advanced settings to map campaign data from your advertising sources to your conversion events](https://res.cloudinary.com/dmukukwp6/image/upload/Screenshot_2025_12_09_at_3_15_33_PM_d4a04d2a94.png)

Configure how PostHog maps campaign data from your advertising sources to your conversion events. These settings give you granular control over how campaign identifiers and sources are matched for attribution.

#### Campaign field preference

![Campaign field preference settings showing options to choose between campaign name and campaign ID](https://res.cloudinary.com/dmukukwp6/image/upload/Screenshot_2025_12_09_at_3_16_25_PM_67afdd8f63.png)![Campaign field preference settings showing options to choose between campaign name and campaign ID](https://res.cloudinary.com/dmukukwp6/image/upload/Screenshot_2025_12_09_at_3_15_41_PM_8717ecf7d4.png)

For each advertising platform, you can choose whether to map campaigns using the **campaign name** or **campaign ID**:

-   **Campaign name**: Uses the human-readable campaign name from your ad platform (e.g., "Summer Sale 2025")
-   **Campaign ID**: Uses the platform's unique campaign identifier (e.g., "123456789")

This setting determines which field is matched against the `utm_campaign` parameter in your [conversion events](/docs/web-analytics/marketing-analytics.md#conversion-goals). Choose the option that matches how you structure your UTM parameters.

#### UTM campaign manual mappings

![UTM campaign manual mappings interface showing custom campaign mapping configuration](https://res.cloudinary.com/dmukukwp6/image/upload/Screenshot_2025_12_09_at_3_16_30_PM_8ec98c0122.png)![UTM campaign manual mappings interface showing custom campaign mapping configuration](https://res.cloudinary.com/dmukukwp6/image/upload/Screenshot_2025_12_09_at_3_15_45_PM_91942d7d0e.png)

Map arbitrary `utm_campaign` values to specific campaign names or IDs from your [advertising platforms](/docs/web-analytics/marketing-analytics.md#data-source-configuration). This is useful when:

-   Your UTM parameters use different naming conventions than your campaign name or ID
-   You want to consolidate multiple campaign variations under a single campaign
-   You're tracking campaigns across multiple channels with different UTM campaign naming

For example, you can map `utm_campaign=summer-promo` to the Google Ads campaign named "Summer Sale 2025" or to campaign ID "123456789", depending on your campaign field preference.

When entering a `utm_campaign` value, PostHog suggests matching campaigns from your advertising platform based on string similarity. Click a suggestion to auto-fill the campaign field. Suggestions show the match percentage and display both the campaign name and ID for clarity.

#### Custom source mappings

![Custom source mappings showing allowlisted UTM sources per advertising platform](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/Screenshot_2025_12_09_at_3_16_33_PM_64be31b2d2.png)![Custom source mappings showing allowlisted UTM sources per advertising platform](https://res.cloudinary.com/dmukukwp6/image/upload/Screenshot_2025_12_09_at_3_15_49_PM_a509d013da.png)

Control which UTM sources are attributed to each [advertising platform integration](/docs/web-analytics/marketing-analytics.md#native-sources). For each platform (Google Ads, LinkedIn Ads, Meta Ads, etc.), you can:

-   **Allowlist specific sources**: Define which `utm_source` values should be attributed to this platform
-   **Support multiple sources**: Map multiple UTM source values to a single advertising platform

This is particularly useful when:

-   You use custom UTM source values that don't match the default platform names
-   A single campaign spans multiple traffic sources

**Example configuration:**

-   [Google Ads](/docs/cdp/sources/google-ads.md) integration: Allowlist sources `google`, `google_ads`, `paid_search`
-   [LinkedIn Ads](/docs/cdp/sources/linkedin-ads.md) integration: Allowlist sources `linkedin`, `li`, `linkedin_paid`
-   [Meta Ads](/docs/cdp/sources/meta-ads.md) integration: Allowlist sources `facebook`, `instagram`, `meta`

### Base currency

![Base currency configuration](https://res.cloudinary.com/dmukukwp6/image/upload/bc_white_26b15e2184.png)![Base currency configuration](https://res.cloudinary.com/dmukukwp6/image/upload/bc_dark_c6547dfdb9.png)

PostHog converts currency values for the entire team to the base currency you set in [your project settings](https://app.posthog.com/settings/project#base-currency) before displaying them. If we can't properly detect your currency from the source data, we'll assume it's in the base currency as well.

### Community questions

Ask a question

### Was this page useful?

HelpfulCould be better