--- title: "Separate Instagram Ads Message on Instagram DM" slug: "separate-instagram-ads-message-on-instagram-dm" description: "Handle messages from Instagram Ads separately in MindBehind, set up custom flows to respond differently to ad-driven DMs and regular conversations." tags: ["instagram ads ", "instagram dm", "instagram integration", "mindbehind "] updated: 2026-10-12T13:37:53Z published: 2026-10-12T13:37:53Z canonical: "academy.insiderone.com/separate-instagram-ads-message-on-instagram-dm" --- > ## Documentation Index > Fetch the complete documentation index at: https://academy.insiderone.com/llms.txt > Use this file to discover all available pages before exploring further. # Separate Instagram Ads Message on Instagram DM You can categorize user direct messages (DM) based on their message type, determine whether they originated from an advertisement, and trigger a tailored flow specific to the message type of the direct message user. To learn how to separate user's DM's according to their message type, you can follow the steps below: 1. Create an advertisement on Instagram that directs your customers to the direct message box of your account. ![](https://cdn.document360.io/c6df4583-da94-4cb2-bb8a-be0cbdd11109/Images/Documentation/mbyeni.png) 2. Publish the MindBehind Chatbot to the Instagram channel. Refer to [Publish Your Bot to Instagram](/docs/how-to-publish-your-bot-to-instagram) to learn how to publish your bot. 3. To arrange the bot flow to separate users’ DM's, put a [**Logic Action**](/docs/how-to-use-logic-action) at the beginning of the flow to set a statement. 4. Set the statement as “If the LASTMESSAGETYPE is equal to INSTAGRAM_ADS” and set the connection of this statement to the flow you desired. 5. For the "ELSE" scenario, you can set a **fallback connection**. So, if the “if statement” is not satisfied, the user will continue to the settled fallback scenario. 6. After these settlements, the chatbot will be able to separate users if they were forwarded to DM from an Instagram Advertisement or not. Make sure that you **save** and **publish** the bot to the Instagram channel after changes. ![](https://cdn.document360.io/c6df4583-da94-4cb2-bb8a-be0cbdd11109/Images/Documentation/how-to-separate-instagram-ads-message-on-instagram-dm-image-aaz3u8ip.jpg) 7. After the flow is designed as described and changes are published to the Instagram Channel, you can send a DM to any advertisement on your Instagram Page with a random text. Since you sent a DM directed from an advertisement, you will continue on the flow that is created for advertisement DMs. 8. In the other scenario, if you send a DM without being directed from an ad, the other flow will be continued, which is designed for **regular** DMs. ![](https://cdn.document360.io/c6df4583-da94-4cb2-bb8a-be0cbdd11109/Images/Documentation/mbyeni2.png) 9. If needed, the same logic for other "messageTypes" can also be used and detected. You can follow the steps below to separate user DMs according to mention, reels, or image answers. You can see some of the examples below. - If "LASTMESSAGETYPE" equals "IMAGE": If the user message is coming as a DM answer to the **image** that you shared - If "LASTMESSAGETYPE" equals "INSTAGRAM_STORY_MENTION": If the user message is coming as a DM, answer to the **Story** that you shared. - If "LASTMESSAGETYPE" equals "REELS": If the user message is coming as a DM answer to the **Reels** that you shared. 10. It is also possible to separate user DMs according to their **values** instead of **types**. Using the same structure, "messageValue" should be stated with the desired user message. MessageValue is the direct message that the user sends, which means it is whatever the user types and sends. You can see an example below: If "LASTMESSAGEVALUE" equals "hello": If the user message is “hello” itself, make that user follow the **flow1**.