Ads’ URLs not working & catching all UTM parameter issues

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.

Notion image

Video Tutorial

Instructions

  1. Add Select Facebook Ad Account ids node. Choose your Facebook account.
  1. Add Fetch Facebook Ad ids node. Connect ad_account_ids sockets. In the effective_status socket, choose ACTIVE to fetch only active ads.
  1. Add Extract Facebook URLs node. Connect ad_ids sockets.
  1. Skip this step if you are not running any app install campaigns. Add Filter node. Connect urls to items. Add/url as a pointer in the filters socket not contains as operator and itunes.apple.com as value. Add another filter, add /url as a pointer, not contains as operator, and play.google.com as value.
  1. Add Health Check URLs node. Add 10000 to max_request_duration socket.
  1. Add Replace List String node. Connect items (Filter) to data_list. Select URL with Id schema. In the pointer socket input /url, as regex use \?.*.
  1. Add Filter node. Connect results to items. Add one filter with a pointer /code, operator greater than 400 as a value.
  1. Ad If node. Connect items to a input [] to b, and select a ≠ b (not equal) as a condition.
  1. Add Select Slack Conversation Id node. Next, choose the right slack channel.
  1. 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."
        }
    }
]
  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.
  • 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. 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