4. Actions to Pause Over-Pacing Campaigns
These actions build upon the views/SQL created to connect Creative / Budget Sheet information to Facebook spend. You can see instructions on how to create that base view here:
In these instructions, we’ll focus on how to take that query to the next level to:
Create Actions to automatically pause over-pacing campaigns.
Single Out Over-Pacing Campaigns
Instructions:
Create your over-pacing 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
Create your Action
Navigate to Alli Actions by selecting Automate Campaigns then select Create Action
Filter down the list and select the Update Campaign Status - Disable Action Type
Name your action and select your authenticated account
Select Alli Data and place the name of the view you created above in step #1 in the
Report of Datasource name
& click SelectReview your action setup
Save and Schedule your action to run
SQL
Context:
{client_name.example_connected_fb}
should correspond to the name of the SQL View/Report you created earlier (in the Connecting Budget to Spend step). Replace this with your client name and the name you gave your reportEnsure that your
{client_name.example_connected_fb}
datasource contains a campaign_id column for FacebookWe add Percent Spent by dividing
total_spend_to_date
bybudget
. If either of these columns have different names in your view, switch out those namesReplace the
{#}
with whatever threshold you are looking forwhere percent_spend >
looks at our newly created columns, and only pulls out rows where the Percent Spend is greater than or equal to the number we pass.To adjust that, for example to see campaigns that are overpaced: utilize
where percent_spend >= 100
. Or to filter to campaigns with greater than or equal to 80%, utilizewhere percent_spend >= 80
>=
is inclusive, so greater than or equal to our threshold. You can also utilize>
to only select campaigns with greater than the threshold you set
select distinct campaign_id as id from (select *,
(total_spend_to_date / budget) * 100 as percent_spend
from {client_name.example_connected_fb}
where percent_spend >= {#})
Live Example with real datasources
select distinct campaign_id as id
from
(select *,
(total_spend_to_date / budget) * 100 as percent_spend
from client_name.example_connected_fb
where percent_spend > 100)