Reddit Ads
Reddit Ads is an advertising platform for creating, managing, and analyzing advertising campaigns on Reddit.
Bruin supports Reddit Ads as a source for Ingestr assets, and you can use it to ingest data from Reddit Ads into your data warehouse.
To set up a Reddit Ads connection, add a configuration item to .bruin.yml and reference it from an ingestr asset. You need an OAuth access_token and a comma-separated list of account_ids. See the official ingestr Reddit Ads documentation for the OAuth flow and account ID discovery steps.
Configuration
Step 1: Add a connection to .bruin.yml file
To connect to Reddit Ads as a source, add a reddit_ads connection to the connections section of .bruin.yml:
connections:
reddit_ads:
- name: my-reddit-ads
access_token: "token_123"
account_ids: "id_123,id_456"access_token(required): OAuth2 access token used to authenticate with the Reddit Ads API.account_ids(required): Comma-separated Reddit Ads account IDs to retrieve data for.
Bruin uses the reddit_ads connection key in .bruin.yml. The underlying ingestr source URI scheme is redditads://, as required by ingestr.
Step 2: Create an asset file for data ingestion
Create an asset configuration file to define the data flow:
name: public.reddit_ads_campaigns
type: ingestr
connection: postgres
parameters:
source_connection: my-reddit-ads
source_table: 'campaigns'
destination: postgresname: The name of the asset.type: Specifies the asset type. Set this toingestrto use the ingestr data pipeline.connection: The destination connection, which defines where the data should be stored.source_connection: The name of the Reddit Ads connection defined in.bruin.yml.source_table: The Reddit Ads table to ingest. See Available Source Tables for options.destination: The destination connection name.
Available Source Tables
Reddit Ads source allows ingesting the following tables:
| Table | PK | Inc Key | Inc Strategy | Details |
|---|---|---|---|---|
accounts | id | - | replace | Retrieves all ad accounts accessible by the authenticated user. |
campaigns | id | - | replace | Retrieves campaigns for each ad account. |
ad_groups | id | - | replace | Retrieves ad groups for each ad account. |
ads | id | - | replace | Retrieves ads for each ad account. |
posts | id | - | replace | Retrieves ad posts and creatives for each ad account. |
custom_audiences | id | - | replace | Retrieves custom audiences for targeting. |
saved_audiences | id | - | replace | Retrieves saved audience configurations. |
pixels | id | - | replace | Retrieves conversion tracking pixels. |
funding_instruments | id | - | replace | Retrieves funding instruments for each ad account. |
custom | level_id, breakdowns | date | merge | Retrieves advertising performance reports for selected levels, breakdowns, and metrics. |
Example
To ingest campaigns:
name: public.reddit_ads_campaigns
type: ingestr
connection: postgres
parameters:
source_connection: my-reddit-ads
source_table: 'campaigns'
destination: postgresCustom Reports
The custom table uses the Reddit Ads Reports API to retrieve performance data such as impressions, clicks, reach, and spend, broken down by dimensions such as date, country, community, or device.
Format:
custom:<level>,<breakdowns>:<metrics>Parameters:
level(required): Reporting level. Must be one ofaccount,campaign,ad_group, orad.breakdowns(optional): Comma-separated breakdown list after the level. Valid breakdowns includedate,country,region,community,placement,device_os,gender,interest,keyword, andcarousel_card. Reddit Ads supports up to two breakdowns per report.metrics(required): Comma-separated metrics to retrieve, such asimpressions,reach,clicks,spend,ecpm,ctr, andcpc.
By default, ingestr fetches custom report data from January 1, 2020 to the current date. You can provide a custom range with the asset start and end interval settings.
Custom Reports Examples
Retrieve daily campaign performance data
name: public.reddit_ads_campaign_daily
type: ingestr
connection: postgres
parameters:
source_connection: my-reddit-ads
source_table: 'custom:campaign,date:impressions,clicks,spend'
destination: postgresThe applied parameters for the report are:
- level:
campaign - breakdowns:
date - metrics:
impressions,clicks,spend
Retrieve ad group performance by country
name: public.reddit_ads_ad_group_country
type: ingestr
connection: postgres
parameters:
source_connection: my-reddit-ads
source_table: 'custom:ad_group,date,country:impressions,reach,ctr'
destination: postgresThe applied parameters for the report are:
- level:
ad_group - breakdowns:
date,country - metrics:
impressions,reach,ctr
Step 3: Run asset to ingest data
bruin run assets/reddit_ads.asset.ymlAs a result of this command, Bruin will ingest data from the given Reddit Ads table into your destination database.