Yes, this can be achieved using the Endear Triggers available in Shopify Flow. Shopify Flow is a Shopify app that allows you to create workflows that modify your shopify data based on specific triggers.
You can create a Shopify workflow that will let you tag your orders in Shopify using the Endear "Message Attribution Changed" trigger. Whenever a message attribution (a sale attributed to a message in Endear) is created, updated, or deleted, you can use that information to modify the order affected in your shopify instance.
Since we have these three distinct states, we need to account for all of them when creating our workflow.
How to create a workflow using the Message Attribution Changed
Install both the Shopify Flow and Endear applications (Learn How)
Add the Message Attribution Changed trigger.
Add a condition to check if the message attribution is deleted or not.
If the attribution is not deleted,
We will add a condition to check if the tag we will be adding to the order already exists. This way we prevent orders from being tagged multiple times.
If the tag already exists, we do not have to make any changes.
If the tag does not already exist, we will add a tag to the order.
If the attribution is deleted, we will set an action to remove the tag from the order.
Here is a reference image of how the workflow should look.
Endear Trigger Properties
Order
order_id — The Shopify order ID
Attribution status
Status — The current state of the attribution: the attribution status (e.g. "CONFIRMED"), "EXCLUDED" (manually excluded), or "DELETED"
Message attribution is deleted — true if the attribution has been deleted, false otherwise
Message details
Days to convert — Number of days between the message and order conversion
Message id — The Endear message ID
Message type — The message channel (e.g. Email, SMS)
Sender details
Message sender id — The sender's Endear user ID
Message sender username — The sender's username
Message sender email address — The sender's email address
Message sender phone number — The sender's phone number
Message sender first name — The sender's first name
Message sender last name — The sender's last name
Message sender first name initial — The sender's first name initial (uppercase)
Message sender last name initial — The sender's last name initial (uppercase)
Team details
Message sent from team id — The ID of the team the message was sent from
Message sent from team name — The name of the team the message was sent from
Attribution metadata
Message attribution id — The specific message attribution ID
Message attribution create date — When the attribution was created
Message attribution update date — When the attribution was last updated

