Skip to main content
Skip table of contents

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.

  1. 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)

  2. 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)

    1. Breakout = how you group your adsets to determine what audiences should be applied to each

    2. Type = Inclusion or Exclusion (this is not case-sensitive, so inclusion or exclusion also works, but spelling matters)

    3. audience name = the exact audience name pulled from Facebook audience manager (spelling/syntax matters here)

SQL View Set-Up

  1. Create your base SQL

    1. Login to Alli Data and select the client you want to create an action for

    2. Navigate to Reports → Explorer and select New Data Report

    3. Give your report a Name and update the Report Type to Custom Redshift

    4. Copy and paste the SQL Example in from below and update anything within and including { } to match your client settings

    5. Once your SQL is updated, click Publish to update the query

    6. Click Preview to ensure the output is as expected

SQL Example

Context

  • replace six_flags with your client name

  • lines 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 from six_flags.audience_adset_inclusionexclusions),

CODE
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

  1. Navigate to the Marketplace within Alli and select ‘Discover’

  2. Either using the Search feature, or scrolling through the available options, select Alli Custom Alert

  3. 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.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.