Ads don’t have any UTM parameters

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.

Notion image

Video Tutorial

Instructions

  1. Add Fetch Facebook Ad Ids node. Select ACTIVE effective_status.
  1. Add Select Facebook Ad Account Ids node. Choose a Facebook account.
  1. Add Extract Facebook Ad URLs node. Connect ad_ids sockets.
  1. 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.
  1. Add Build a pattern node. Choose the UTMs you want to check.
  1. Add Match URL patterns node. Connect patterns sockets.
  1. Add If node. Connect results to a. Enter [] into a socket b. Choose not equal as a condition.
  1. 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."
        }
    }
]
  1. Add For each node. Connect results (Match URL patterns) with items.
  1. Add Patch JSON node. Connect item to value. Paste the following schema into the data socket:
[
    {
        "type": "section",
        "text": {
            "type": "mrkdwn",
            "text": ""
        }
    },
    {
        "type": "actions",
        "elements": [
            {
                "type": "button",
                "text": {
                    "type": "plain_text",
                    "text": "Open in Ads Manager"
                },
                "url": ""
            }
        ]
    }
]
  1. 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]
  1. Add Slack Notifier node. Connect tread_ts sockets. Connect data (Patch JSON) to blocks.
  1. Add Select Slack Conversation Id node. Choose the right slack channel. Connect conversation_id sockets.
  1. Add Delay to node. Choose the delay time in seconds.

For excluding certain ads from the check:

  1. Add Select Facebook Ad Ids node. Next, select the ads that you don’t want to check.
  1. Add Patch JSON list node. Add remove patch:
  • path /context/ui
  1. Add Calculate Set Operation node. Choose difference operator. Connect data_list(Patch JSON) to a. Connect ad_ids (Fetch Facebook Ad Ids) to b. Connect data to ad_ids (Fetch Facebook ads).
 
Did this answer your question?
😞
😐
🤩

Last updated on August 6, 2021