(*Just to be clear, when I say โrandomlyโ, Iโm referring to the method by which I select the recommendation to insert; the people I recommend are carefully chosen. ๐)
Effective email marketing is all about making your subscribersโ experience as rich as possible. The more useful and relevant you can make your messaging, the more likely people are to stick around.
I believe that by adding more value, my subscribers win
When I send out my weekly emails, I sometimes recommend people I believe can add value to my email subscribers.
Those I recommend arenโt necessarily involved in โemail marketingโ (in fact, most arenโt), but they are business-related in some way and add can value that complements what I provide.
For example, I have subscribers on my list who are B2B freelancers, and I believe they can benefit from the learnings of other non-email marketing-focused professionals, e.g. business coaches, content creators, and solopreneurs who have successfully managed to carve out a niche for themselves.
As a freelancer myself, Iโm always keen to give as much support as I can to the freelance community, as it can be a challenging and lonely place to be.
How I use Liquid code to randomly recommend others
I combine two powerful features to produce my inline email recommendations;
- Liquid templating language (created by Shopify, supported by ConvertKit)
- ConvertKitโs โRecommendationsโ feature.
The Liquid templating language is a very powerful open-source project that many email service providers support, meaning we can leverage it in our emails.
Donโt worry too much about knowing (or learning) Liquid in detail, because in reality, we can often copy and paste what someone else has already created.
The curly braces and percentage symbols are what encapsulate the Liquid code.
The first line (below) creates a variable (called โminโ) and assigns a value to it (โ1โ).
Then next line of code repeats the previous one, but this time itโs creating โmaxโ and assigning the value of โ5โ.
Now, in this line of code (below), weโre creating the variable called โdiffโ and assigning a value by doing a calculation of subtracting โminโ from โmaxโ (i.e. diff = (5 โ 1), i.e. 4).
Next, we get Liquid to produce a random number for us by using a mathematical function called โmoduloโ whilst interrogating the current date (the use of โdateโ is irrelevant, itโs purely being used as a variable to generate a new number for the randomiser).
In simple terms, the function produces a randomised number from (1,2,3, and 4 โ these are the possible values when we subtract โminโ from โmaxโ, i.e. 5 โ 1 = 4 possibilities).
Now we take the value that had randomly been generated (itโs going to be 1, 2, 3, or 4) and assign it to the variable called โrandomNumberโ).
Okay, take a deep breathโฆ you made it this far! (Btw, well done for sticking with me!)
Now, things get simple โ we add 4 possible options to our email, each assigned one of the possible values, and then display the recommendation associated with that number.
So, we do a comparison check using the โ==โ operator.
If itโs equal to โ1โ, show this oneโฆ if itโs equal to โ2โ, show this oneโฆ etc.
I always add a catch-all โelseโ so that no matter what happens, the email will still make sense.
And you must close the Liquid code by using the โendifโ tag.
Making it easily-accessible in every email
If you want to take your Liquid code to the next level, then build it inside a โSnippetโ.
If youโre not sure what โSnippetsโ are, check out this article where I explain how to create them, and when to use them.
Letโs look at what this example looks like, inside a ConvertKit โSnippetโ.
Once you have created your โSnippetโ, you can use it as many times as you wish, in as many emails as you need, simply by inserting it into your email using the editor element;
Once you select the snippet, the entire content will be displayed inside your email.
โก๏ธWhat to do nowโฆ
Open up a new โBroadcastโ email inside ConvertKit and create your first little bit of Liquid code to see how it looks when you send the email. You can copy and paste the code I use in this article if you wish, but have a play around with it and find how you want to leverage its power in your system.
Have a go and let me know how you get on. ๐๐