Link Studio docs › Tracking
Privacy and consent
Link Studio records visits for you, so your visitors should hear about it from you. Here is text for your privacy policy, and how to load the tracker only once a visitor agrees.
Text for your privacy policy
Add this to your own privacy policy. Keep the part in brackets if you ask for consent before loading the tracker.
Our Data Processing Agreement applies automatically when you use Link Studio, and our sub-processors page lists the providers involved.
Load the tracker after consent
The tracker sets its cookies as soon as it loads, so add it only once the visitor agrees. The first line of your snippet, the one that starts window.linkStudio, stores nothing. Keep it on every page, and anything you track before the tracker loads is sent once it does.
With your own cookie banner
- Keep the first line of the snippet on every page, and remove the line that loads the tracker.
- Add this function to your site, with your own key.
- Call
loadLinkStudio()when the visitor accepts analytics, and on every later page they visit once they have.
function loadLinkStudio() {
if (window.linkStudioLoaded) return;
window.linkStudioLoaded = true;
var script = document.createElement("script");
script.src = "https://app.linkstudio.link/t.js";
script.dataset.key = "YOUR_KEY";
document.head.appendChild(script);
}Shopify
Shopify's Customer Privacy API tells you whether a visitor allows analytics. In your theme, keep the first line of the snippet and add this instead of the line that loads the tracker.
<script>
function loadLinkStudio() {
if (window.linkStudioLoaded) return;
window.linkStudioLoaded = true;
var script = document.createElement("script");
script.src = "https://app.linkstudio.link/t.js";
script.dataset.key = "YOUR_KEY";
document.head.appendChild(script);
}
window.Shopify.loadFeatures(
[{ name: "consent-tracking-api", version: "0.1" }],
function (error) {
if (error) return;
var privacy = window.Shopify.customerPrivacy;
if (privacy.analyticsProcessingAllowed()) loadLinkStudio();
}
);
document.addEventListener("visitorConsentCollected", function (event) {
if (event.detail.analyticsAllowed) loadLinkStudio();
});
</script>Google Tag Manager
- Add a Custom HTML tag with your whole Link Studio snippet.
- In the tag's Advanced settings, open Consent settings, choose Require additional consent for tag to fire and add
analytics_storage. - Fire it on All Pages, and on the event your consent tool sends when someone accepts, so it also runs on the page where they agree. Then publish.
If someone changes their mind
Stop loading the tracker on later pages, and delete what it stored in their browser. Our Privacy Policy lists the cookies and browser storage it uses, and most consent tools can delete them for you when someone opts out.