In Mailocator, you can easily dynamically replace or add content using shortcuts, such as pre-filling hidden input, adding text to content from the dataLayer, changing images, and much more.
Adding an email address to a thank you page
Insert %%email%%%
anywhere in the text and this shortcode will be replaced with the user's email you just retrieved. This can make the thank you more personal.
Values of the current session
This is useful if you want to send the URL from which the user logged in or made a conversion, for example, to the integrated tool along with the data. These values are replaced between a compound bracket and a cross character, for example [#URL#]
.
You can easily add the shortcut including the field directly in Editor > Input manager
.
Overview of values
[#TIMESTAMP#] | Unix Timestamp | |
[#YYYMMDD#] | Today's date, wildcard order can be changed | |
[#HH:II#] | Current hour and minute | |
[#IP#] | User's IP address | |
[#HOST#] | Domain of the page the user is on | |
[#COUNTRY#] | Name of the country where the user is located | |
[#CONTINENT#] | Name of the continent where the user is located | |
[#DEVICE#] | User's device type: desktop or mobile | |
[#AGENT#] | User's browser signature | |
[#URL#] | Encoded URL where the user is currently located | [#URL#] |
[#URL_DECODED#] | URL the user is currently at |
Displaying promo codes
Display the obtained promocode
(for example in gamification) in the text in place of the {{PROMO_CODE}}
abbreviation and its description {{{PROMO_CODE_TEXT}}
DataLayer content
Override the increasingly popular data layer anywhere in the table of contents by enclosing the dataLayer
value in square brackets, for example: [[pageType]]
.
If there are more than one identical object in the dataLayer, the most recently added one is always used.
Data from external APIs
Mailocator allows you to query data from external API
and other sources in real time. The returned data must be in a simple JSON structure. Such data can be displayed by enclosing its name between square brackets and a colon, for example [:currentWeather:]
.
Practical code samples
Everything can be done directly in the editor without having to modify the source code directly.
Acknowledgements
<p class="thank-you">
We just sent a message to your %%email%% address!
</p>
Passing the URL to the built-in tool
<input type="hidden" value="[#URL#]" name="opt_url">
Display winnings with promo code
<p class="prize">Your discount code is {{PROMO_CODE}} !</p>
Pass page type from dataLayer
<input type="hidden" value="[[pageType]]" name="opt_pagetype">
Display data from external API
<p class="weather">
<img src="https://mlcdn.eu/weather/image/[:icon:].png">
</p><p>Today is [:currentWeather:], the perfect weather for shopping...</p>
<p></p>
.