1. Help Center
  2. Campaign Builder

SiteData Merge Tags

SiteData is our signature targeting option that helps you show or hide campaigns based on any data you have in your data layer about a visitor, such as cart value, products viewed, search terms, and so on.

In addition to the targeting option and trigger, you can also use the information in your SiteData storage as merge tags in your campaigns’ text fields, input fields, and integrations.

Merge tags help you personalize your campaigns for each visitor, prefill your input fields, and send richer lead data to your ESP.

But, first things first.

Prefer to see it in action? Watch this video by Kristian, where he explains how SiteData merge tags work and how you can set it up in Google Tag Manager:

How SiteData Merge Tags Work

Whatever data you’re sending to Sleeknote SiteData, you can use it as a merge tag in your campaigns.

💡 Read this article to learn how to send data to SiteData.

If you’re using Google Tag Manager, your variables might look like this:

GTM Variable is what your variable is called in Google Tag Manager and must be written exactly the same way as everywhere else in your GTM account.

SiteData Variable is the name you want to give to your variable while sending it to us. You’ll use this variable name, such as “Total Basket Value” or “User ID,” in your Sleeknote account.

Fallback Value for Merge Tags

If the value of your SiteData merge tag is empty for a visitor (i.e. you don't have the data,) we won't show any value. For example, if you use a merge tag for first name “Hello name,” they'll see it as "Hello".

If you want to set a fallback value, instead, you can do this in your tag manager. (For example, you can set a default version as “Hello there.”)

To do that, create a new tag and add a default value in the following format:

So, if you want your fallback value to be "there," simply write "there" to the field shown above.

“Your SiteData Variable” must be written in the exact same way as you send it to SiteData.

🚨 Important: You should send the above tag (with default value) to SiteData as early as possible, before you load the Sleeknote script. Then, if an event or trigger (such as Add to Cart) is triggered and a GTM Variable is sent to SiteData, this variable will overwrite the default value.

How to Use Merge Tags in Campaigns

Simply follow this format to use SiteData merge tags in your campaigns:

{{SiteData:Your SiteData Variable}}

For example, your merge tag might look like this:

{{SiteData:Total Basket Value}}

No matter where you want to use merge tags, all you need to do is to write them in the format above. 😌

Merge Tags in Text Fields

By using SiteData merge tags in text fields, you can personalize your campaigns for each visitor.

For example, if you have a variable in your data layer that checks the value of items in a visitor’s cart and calculates what’s left until free shipping, you can use this variable as a merge tag in your campaigns:

Or you can welcome your customers with their first name when they log in to your site:

Merge Tags in Input Fields

By using merge tags, you can prefill your campaign input fields with the data you already have in your SiteData storage.

For example, if you already have a first name or email address for a visitor, you can pre-populate those input fields in a campaign.

To do this, click the input field you want to prefill and use the option “Change Value Attribute."

Write your variable as in the field and use the variable you want to get from SiteData, such as name, gender, country, email address, and so on.

This way, you won’t ask the same question over and over, and make it easier for visitors to fill out your forms. 🚀

Merge Tags in Integrations

Last but not least, you can use SiteData merge tags to send more lead data to your ESP as a custom field.

For example, you can send the basket value, the number of products shown, time spent on the page, and so on to your ESP along with new signups for richer lead data and better segmentation.

To do that, go to the mapping step of your integration and select “Want to send custom data?”:

Write your variable in the format and map it to the corresponding ESP field.

Whatever session data you have during the signup, you can send it to your integration with merge tags. 🎉

Advanced SiteData Functions

You can also use more advanced functions, such as logic, string concatenation, and math functions with SiteData.

One of the best use cases of this functionality is calculating the difference between your free shipping threshold and a visitor's cart value.

Say you offer free shipping for orders above €500 and want to nudge shoppers when they add an item for less than that amount to their cart.

If you send the cart value variable to our SiteData storage, you can then calculate the difference between €500 and the visitor’s cart value with this formula:

SUM(SITEDATA(cart_total), - 500)*-1

Remember to replace “cart_total” with the name of your SiteData variable.

You can use this formula in your campaign’s text fields like this:

When a visitor adds, for instance, items worth €150 to their cart, the campaign will calculate the difference automatically:

Be aware that platforms like Shopify might send the cart value variable in a different format. Reach out to our Customer Success team if you need help with this advanced function. 👋