30 mins to complete
In this video, you are going to learn how you can send Slack notifications if your ads are missing UTM parameters.
Video Tutorial
Instructions
- Add Fetch Facebook Ad Ids node. Select ACTIVE
effective_status
. - Add Select Facebook Ad Account Ids node. Choose a Facebook account.
- Add Extract Facebook Ad URLs node. Connect
ad_ids
sockets. - Add Filter node if you want to exclude app URLs or ones you don’t set up UTMs for. Setup the filter that you need. Connect
urls
to items. - Add Build a pattern node. Choose the UTMs you want to check.
- Add Match URL patterns node. Connect
patterns
sockets. - Add If node. Connect
results
toa
. Enter[]
into a socketb
. Choosenot equal
as acondition
. - Add Slack Notifier node. Use the following schema in the
blocks
socket:
[
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "⚠️These ad(s) has at least one incorrect UTM parameter."
}
}
]
- 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{{inputValue("/pattern/regex")}}
to insert the dynamic value, in our case, it’s the UTMs pattern that was expected,{{inputValue("/pattern/description")}}
for actual UTMs and{{inputValue("/url/url")}}
for the examined URL. - path
/1/elements/0/url
, use the following string as a value to build a link:https://business.facebook.com/adsmanager/manage/ads?act={{inputValue("/url/id/context/ad_account_id/id")}}&filter_set=SEARCH_BY_ADGROUP_IDS-STRING_SET%1EANY%1E[%22{{inputValue("/url/id/id")}}%22]
- Add Slack Notifier node. Connect
tread_ts
sockets. Connectdata
(Patch JSON) toblocks
. - Add Select Slack Conversation Id node. Choose the right slack channel. 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).