Google Tag Manager
Add DataSaaS analytics through Google Tag Manager. This method is ideal if you already use GTM to manage your tracking tags.
Log in to Google Tag Manager
Go to tagmanager.google.com and log in to your account.
Select your container
Choose the container for the website where you want to add DataSaaS tracking.
Create a new tag
In the left sidebar, click Tags, then click New to create a new tag.
Name and configure the tag
Name the tag "DataSaaS Analytics". Click Tag Configuration and select Custom HTML.
Paste the tracking code
Paste the following code into the HTML field:
<script>
(function() {
var script = document.createElement('script');
script.defer = true;
script.setAttribute('data-website-id', 'ds_YOUR_WEBSITE_ID');
script.setAttribute('data-domain', 'yourdomain.com');
script.src = 'https://datasaas.co/js/script.min.js';
document.head.appendChild(script);
})();
</script>Set the trigger
Click Triggering and select All Pages. This ensures DataSaaS loads on every page of your website.
Save and publish
Click Save to save the tag. Then click Submit in the top right corner and Publish your changes to make them live.
Verify
Visit your website and check your DataSaaS dashboard. You should see your visit appear within seconds.
We use document.createElement instead of a regular <script> tag because Google Tag Manager strips standard script tags when injecting Custom HTML. The createElement approach ensures the script is properly loaded with all its data attributes intact.
You can use GTM's Preview mode to test the tag before publishing. This lets you verify that the DataSaaS script loads correctly without affecting your live site.