9. Alerting on Missing Facebook Audience Inclusions/Exclusions- Advanced/Specific
This view allows you to classify your adsets into groups, and alert on adsets are missing specific audiences within their inclusions or exclusions
Instructions
Data Source Set-Up
This requires that structural data has been set up (specifically the facebookads_structure_adsets
datasource). If your client does not have this datasource, please reach out to the PMG team to get your client onboarded.
This also requires a “rules” datasource, manually set-up and maintained by the team. You can leverage your choice of manual datasources: Google Sheets, Smartsheet, Airtable, or manual (direct csv upload)
Follow the specific set-up instructions of your desired type. Your final output should include 3 columns (like this example). Each audience (inclusion or exclusion) should have its own line)
Breakout = how you group your adsets to determine what audiences should be applied to each
Type = Inclusion or Exclusion (this is not case-sensitive, so inclusion or exclusion also works, but spelling matters)
audience name = the exact audience name pulled from Facebook audience manager (spelling/syntax matters here)
SQL View Set-Up
Create your base SQL
Login to Alli Data and select the client you want to create an action for
Navigate to Reports → Explorer and select New Data Report
Give your report a Name and update the Report Type to Custom Redshift
Copy and paste the SQL Example in from below and update anything within and including
{
}
to match your client settingsOnce your SQL is updated, click Publish to update the query
Click Preview to ensure the output is as expected
SQL Example
Context
replace
six_flags
with your client namelines 1- 12 is the structural data, you need to only adjust the client name
line 14 is your “rules” datasource
if your columns are not named, breakout, type, and audience_name, adjust the names within the sql accordingly to what you have, and the datasource to your client datasource
Ex:
rules as (select
breakout
as breakout,type
as inclu_exclu_type,audience_name
as missing_audience fromsix_flags.audience_adset_inclusionexclusions
),
with audtype as (select account_id,
id as adset_id,
name as adset_name,
case
when name ilike '%Lookalikes%' then 'Lookalike'
when name ilike '%Website Visitors%' then 'Website Visitors'
else 'Prospecting'
end as audience_type,
targeting_custom_audiences as currently_targeted,
targeting_excluded_custom_audiences as currently_excluded
from six_flags.facebookads_structure_adsets
where effective_status = 'ACTIVE'),
rules as (select breakout as breakout, type as inclu_exclu_type, audience_name as missing_audience from six_flags.audience_adset_inclusionexclusions),
inclusion as (select rules.missing_audience, rules.inclu_exclu_type, audtype.*, position(missing_audience in currently_targeted) as audience_pos
from rules left join audtype
on rules.breakout = audtype.audience_type
where lower(rules.inclu_exclu_type) = 'inclusion'
),
exclusion as (select rules.missing_audience, rules.inclu_exclu_type, audtype.*, position(missing_audience in currently_excluded) as audience_pos
from rules left join audtype
on rules.breakout = audtype.audience_type
where lower(rules.inclu_exclu_type) = 'exclusion')
select distinct * from inclusion where audience_pos = 0
union all
select distinct * from exclusion where audience_pos = 0
Instructions: Setting Up Your Custom Alert
Navigate to the Marketplace within Alli and select ‘Discover’
Either using the Search feature, or scrolling through the available options, select
Alli Custom Alert
The Set-Up instructions drop down contains all the relevant instructions and tips for setup, and are also available on the install page. click
Install App
& follow those instructions.