With SiteData, you can show your campaigns only on specific devices, such as Windows computers or Android smartphones.
To do this, first, you need to create a Google Tag Manager variable that picks up this type of information through the visitor’s browser.
Watch this video to learn how or follow the steps below. 👇
How to Set Up a GTM Variable
- Go to Google Tag Manager and click “Variables.”
- Click “New” under “User-Defined Variables.”
- Click “Choose a variable type to begin setup…” and select “Data Layer Variable” among variable types.
- Type “navigator.platform” as the Data Layer Variable Name.
- Give your GTM variable a clear, memorable name. (Hint: You can call it “navigator.platform” too.)
- Click “Save.”
To send this variable to Sleeknote SiteData, you now need to create the right tag.
How to Set Up a Tag
- Click “Tags” and then “New”.
- Click “Choose a tag type to begin setup…”
- Select “Custom HTML” among tag types.
- Copy and paste the SiteData script from this page.
- Replace “GTM Variable” with the exact name of the variable you just created. (In our example, we name it “navigator.platform”.)
- Replace “Your SiteData Variable” with what you want to call it in Sleeknote. For example, we’ll name it “Device” and in a minute, we’ll use this name in Sleeknote.
7. Move down to “Triggering” and click “Choose a trigger to make this tag fire…”
8. Click “All Pages” (unless you have other preferences) and “Save.”
9. Name your tag, such as “SiteData Device” and click “Save” again.
10. Finally, make sure to click “Submit” and “Publish” to set these changes live on your site.
Now, head over to your Sleeknote account and set up the targeting options for the campaign you want to show on a specific device.
How to Set Up the SiteData Targeting Option
- Log in to Sleeknote and go to “Step 3: Targeting Options” in your campaign builder.
- Scroll down and enable the SiteData condition.
- Enter the name of your SiteData variable exactly as it is in Google Tag Manager. (For example, we just named it “Device” earlier.)
- Choose “contains” from the dropdown menu and write the value you’d like to target, for example, “Android.”
- Decide if you want to “show” or “hide” your campaign for this device.
- Click “Add”.
- Save your campaign as usual.
Now, your campaign will only show to visitors with an Android device.
Use these values to target the following devices and operating systems: iPhone, Android, Win, Mac.
For example, if you want to target Mac computers, use “contains” and write “Mac” as property value.
Hint: Similarly, you can target visitors’ browser language by using “navigator.language” instead of “navigator.platform” in your dataLayer.