20 mins to complete
In this tutorial, you will learn how you can send Slack notifications if your ads’ URLs are faulty. Facebook uses JSON to work with data. If you are not familiar with JSON, refer to the tutorial.
Video Tutorial
Instructions
- Add Select Facebook Ad Account ids node. Choose your Facebook account.
- Add Fetch Facebook Ad ids node. Connect
ad_account_ids
sockets. In theeffective_status
socket, chooseACTIVE
to fetch only active ads. - Add Extract Facebook URLs node. Connect
ad_ids
sockets. - Skip this step if you are not running any app install campaigns. Add Filter node. Connect
urls
toitems.
Add/url
as apointer
in thefilters
socketnot contains
asoperator
anditunes.apple.com
asvalue
. Add another filter, add/url
as apointer
,not contains
asoperator
, andplay.google.com
asvalue
. - Add Health Check URLs node. Add
10000
tomax_request_duration
socket. - Add Replace List String node. Connect
items
(Filter) todata_list
. SelectURL with Id schema
. In thepointer
socket input/url
, asregex
use\?.*
. - Add Filter node. Connect
results
toitems
. Add one filter with apointer
/code
,operator
greater than
400
as avalue
. - Ad If node. Connect
items
toa
input[]
tob
, and selecta ≠ b (not equal)
as acondition
. - Add Select Slack Conversation Id node. Next, choose the right slack channel.
- Add Slack Notifier node. Connect conversation_id sockets. Use the following schema in the
blocks
socket:
[
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "⚠️These ad(s) have a non-functioning URL."
}
}
]
- Add For each node. Connect
results
(Match URL patterns) withitems
. - Add Patch JSON node. Connect
item
tovalue
. Paste the following schema into thedata
socket:
[
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ""
}
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Open in Ads Manager"
},
"url": ""
}
]
}
]
- Add 2 replace patches:
- path
/0/text/text
, use{{input.value/pattern/regex}}
to insert the dymanic value, in our case, it’s the UTMs pattern. - path
/1/elements/0/url
, use the following string as a value to build a link:https://business.facebook.com/adsmanager/manage/ads?act={{input.value/url/id/context/ad_account_id/id}}&filter_set=SEARCH_BY_ADGROUP_IDS-STRING_SET%1EANY%1E[%22{{input.value/url/id/id}}%22]
- Add Slack Notifier node. Connect
tread_ts
sockets. Connectdata
(Patch JSON) toblocks
. Connect conversation_id sockets. - Add Delay to node. Choose the delay time in seconds.
For excluding certain ads from the check:
- Add Select Facebook Ad Ids node. Next, select the ads that you don’t want to check.
- Add Patch JSON list node. Add remove patch:
- path
/context/ui
- Add Calculate Set Operation node. Choose difference
operator
. Connectdata_list
(Patch JSON) toa
. Connectad_ids
(Fetch Facebook Ad Ids) tob
. Connect data toad_ids
(Fetch Facebook ads).