Custom variables allow you to personalise automated messages and other actions by inserting dynamic data. In this guide, we will walk you through the types of custom variables supported by Inrō, how to use them, and some tips for getting the most out of this feature.
Where to use custom variables
Text Messages (DMs)
When creating a new DM, simply insert the desired variables where you want personalized content to appear.
Example: “Hello {{ contact.name }}, we have an update on your recent order.”
Conversion Links
Use variables in the title, subtitle, button text, and URL fields of your conversion links.
Example: “Click here to confirm your order: {{ contact.id }}”
HTTP Requests
Include variables in the URL and parameters of your HTTP requests to send personalized data to external systems.
Example: “https://api.example.com/confirm?user={{ contact.id }}&date={{ trigger.date }}”
Types of Custom Variables
Inrō supports several types of variables that you can use in different actions.
Spintax Variables
Spintax is a simple and fast way to add variations to your messages so they look less like automations and more like real messages.
With this syntax, you can define multiple options for one word or part of your sentence and one of them will be chosen at random when sending the Message or the action.
Spintax example:
{ Hey|Hi|Hello }! How { are you|do you do }?
Note that spintax uses single braces ( { }
) and not double braces ( {{ }}
) like other variables.
Contact Variables
Contact variables change depending on the contact you’re interacting with. They can be used in text messages (DMs), conversion links, and HTTP requests.
Supported Contact Variables:
{{ contact.name }}
: The contact’s name.{{ contact.username }}
: The contact’s Instagram username.{{ contact.id }}
: The contact’s unique ID.{{ contact.email }}
: The contact’s email address.{{ contact.phone }}
: The contact’s phone number.{{ contact.profile_picture }}
: The URL to the contact’s profile picture.
Example Usage:
Hi @{{ contact.username }}, we have an exclusive offer just for you!
We recommend using username
instead of name
as Instagram names are rarely actual names and it can look very automated to use them!
Trigger Variables
Trigger variables change based on the event that triggered the scenario or campaign.
For campaigns, the last message or comment received are used as well as the last ig.me link opened by this contact.
If no message, comment or ref parameter are found, the variable will be returned empty.
Supported Trigger Variables:
{{ trigger.message }}
: The message that triggered the scenario.{{ trigger.comment }}
: The comment that triggered the scenario.{{ trigger.date }}
: The date and time when the trigger occurred, formatted as2024-03-19 11:42:30+00:00
.{{ trigger.ref }}
: Theig.me
link ref parameter that triggered the scenario.
Example Usage:
Thank you for your comment on {{ trigger.date }}: "{{ trigger.comment }}"
Webhook Variables
If your scenario was triggered by a webhook, you can insert the webhook’s body parameters as variables in your actions. This allows you to incorporate data from external systems into your automated messages.
Example Webhook Data:
{
"contact_id": 65427,
"first_name": "John",
"meeting_date": "March 24th, 2024"
}
Example Message:
Hey {{webhook.first_name}}, you meeting is confirmed on {{webhook.meeting_date}}!
Action Variables
Action variables are only available in the context of specific actions. These can include values like survey replies, payment amount, etc.
Single question surveys
This is only available in the automated reply to the option being picked.
{{ survey.option.title }}
: the option that was picked{{ survey.option.replies }}
: the number of people who picked this survey option{{ survey.option.percentage }}
: the percentage of people who picked this survey option{{ survey.date }}
: the date when the survey was answered, formatted as2024-03-19 11:42:30+00:00
.
HTTP Requests
You can insert custom variables into the URL, headers and parameters of an HTTP Request.
You can also use the response from an HTTP Request as variables in the rest of the scenario. Just use the {{ http_request.PATH.TO.JSON.DATA }}
format to access any data from your request and response.
Example HTTP Request data:
{
"request": {
"url": "https://api.myserver.com/puppies",
"method": "post",
"headers": {...},
"payload": {
"name": "Uric",
"breed": "Labrador Retriever",
},
"response": {
"status": 200,
"body": {
"id": "77238",
"message": "Your puppy was created",
}
"headers": {...},
}
}
Example Message:
Hey! {{ http_request.response.body.message }}
💡 You can view your HTTP Request data in JSON format in your Automation scenario history.
When to Use Custom Variables
Custom variables are useful when you want to:
Personalize direct messages (DMs) with user-specific information.
Tailor conversion links to include personalized details.
Use data from webhooks to automate responses with specific user information.
Example Use Case - Identity Verification
Trigger the scenario with a “Verify” keyword, follow it up with an HTTP “Get” request to request the information from your CRM & confirm the verification details with Instagram.
After verifying, use custom variables for the profile name & send personalized messaging to confirm their verification.
As a bonus, try adding a short welcome video to create a stronger connection and a better onboarding experience.
Inrō Insider Tips
Use Detailed Variables: Make your messages more engaging by using variables creatively, often in combination and avoid ones that can make it automation obvious.
Test Your Variables: Always preview and test your messages to ensure variables are correctly inserted and displayed.
Keep It Relevant: Use variables that provide meaningful personalization without overcomplicating your message.
Feedback
If you have any questions or need further assistance, feel free to reach out to our support team or leave a review on this article.