How to Upload Sleeknote SiteData GTM Templates to GTM


Before you can import a Google Tag Manager (GTM) container you need to download a template to upload here.


Once you’ve downloaded your template you can import it into GTM by following the below steps.


Don't want to use a template? Read this guide to learn how to send your variables to SiteData.



How to Import a Template into Google Tag Manager:

  1. Log into your GTM account and click the “Admin” tab.


2. Click “Import Container”.




3. Upload your newly downloaded template from your computer.




4. Choose “Existing” workspace, and choose which of your workspaces you want to import the container to (if you have more than one workspace).


step 4


5. Click “Merge” and “Rename conflicting tag, triggers and variables” to ensure you don’t overwrite any of your existing content.




6. Then you’ll see an overview of the new changes. Click “Confirm”.




7. Click “Submit” in the top right corner.




8. Give your new container a name and click “Publish” to put your changes into effect.




Now you have the variable, tag, and trigger templates. Then you need to edit them manually to make sure they send the right data.

Here’s how:

  1. Go to “Variables”


2. Find your new variable (called "DL_Variable") and click on it.




3. Give your new variable a name for your own identification. For this example, we’ll name it TotalBasketValue.




4. Define your variable by naming it. It’s important that the name matches the same data in your data layer. This is the name of the data layer variable to read from. The value of a data layer variable named 'TotalBasketValue', for example, is set to 'value' when the following code on your website is executed:

dataLayer.push({'TotalBasketValue': 'value'});


(Tip: You can download Datalayer Checker if you have any doubts about what data your website is pushing to GTM).


For this example, we’ll choose ‘TotalBasketValue’. (It’s easier to use the same name throughout to avoid confusion.)




5. Choose “Version 2” from the dropdown




6. Click “Save”.


7. Go to “Triggers”. The triggers are what determines when your data should be sent to our SiteData storage.




8. Find your new trigger template ("DL_Variable Event") and click on it.




9. Name your trigger for your own identification. For this example, we’ll name it ‘AddtoCart’.




10. Now you need to define what event should trigger the data you want to send. This is to identify the event that sends the data to our Sitedata, so it’s important that the name you input in this field is an exact match to the event in your data layer. For this example, I could trigger an event every time someone adds an item to their cart. This event could be named ‘AddtoCart’.

(NOTE: this event might be called something different in your data layer so make sure to check before you enter the event name.)




12. Choose “All Custom Events”. This means the data will be sent every time this event happens. In this example, every time a visitor adds an item to their cart.




12. Click “Save”


13. Go to “Tags”




14. Find your new tag (‘Send DL_Variable to Sleeknote SiteData’) and click on it.




15. Name your tag. We recommend giving your tag the same name as your new variable. In this example, it would be TotalBasketValue.




16. Find “VariableName” in the HTML script and give it a new name so you can identify it. It doesn’t matter what the name is, but we recommend giving it the same name as your variable for easy identification and simplicity. This is the name you have to enter when you set up the SiteData condition for your Sleeknote campaigns. In this example, we’ll name it TotalBasketValue.




17. Find “DL_Variable” and change this to the same name as your variable. It’s important that this name exactly matches the variable name in your data layer. In this example it would be TotalBasketValue.

(TIP: If you delete and start typing {{, you’ll get a list of your variables to choose from as shown below.)




18. Click “Save”


19. Click “Submit” in the top right corner.




20. Give your new changes a name and click “Publish” to put your changes into effect.


Now you send the above data to our SiteData storage and you can set up your campaign based on the above data.


If you want to send more data, you simply repeat the above steps. You can add as many variables, triggers, and events as you’d like.


How to Set Up a Sleeknote Campaign with Our SiteData Condition

When you’ve created your campaign and get to the settings step you can trigger your campaign based on the data you set up above. Here’s how:


  1. Click “Change Rule”


2. Scroll down and click “Add Another Condition”.




3. Choose the “SiteData Detection” condition.




4. Decide if you want to hide or show your campaign based on your site data.





5. Enter the name of your GTM variable. If we use the same example as above this would be ‘TotalBasketValue’.




6. Choose if the value for the variable should match, be less than, or greater than, etc. to show or hide your campaign.




7. Enter the value of your variable. If we use basket value as an example we could enter ‘50’ and then the campaign will only show to users who have a basket value of less than 50 (provided we choose ‘less than’ in the previous step).




8. Click “Save”