Tracking Websites
This guide walks you through installing the Dreamdata JavaScript script on your website. The script is unique to your Dreamdata account and enables comprehensive tracking of website traffic, user behavior, and form submissions.
Prerequisites
Before you begin, ensure you have:
- Access to your Dreamdata account
- Administrative access to your website's HTML code or Google Tag Manager
- (Optional) Access to your Consent Management Platform if you use one
Step 1: Locate Your JavaScript Script
- Log in to your Dreamdata account
- Navigate to Data Platform > Sources > JavaScript v2.0
- Your unique tracking script will be displayed here
Step 2: Choose Your Installation Method
You can install the Dreamdata JavaScript script using one of two methods:
Option A: Direct installation on your website
Option B: Installation via Google Tag Manager
After selecting your preferred method, click Copy to copy the script or Send Instructions by Email to forward the installation instructions to your development team.
Option A: Direct Website Installation
- Copy the JavaScript script from your Dreamdata account
- Paste the script within the
<head>
section of your website's HTML code - Ensure the script is placed before the closing
</head>
tag - Save and deploy your changes
<head>
<!-- Other head elements -->
<!-- Dreamdata Analytics Script -->
// Your Dreamdata script goes here
</head>
Consent Management Platform Integration (Direct Installation)
If you use a Consent Management Platform (CMP), you'll need to configure it to work with Dreamdata Analytics. Follow the setup documentation for your specific CMP:
- CookieBot - Manual implementation guide
- CookieYes - Website integration guide
- CookieInformation - Getting started guide
- OneTrust - Cookie consent setup
- Osano - CMP setup guide
Important: Test your CMP integration thoroughly to ensure tracking works correctly with user consent preferences.
Option B: Google Tag Manager Installation
-
Access Google Tag Manager
- Log in to your Google Tag Manager account
- Select the appropriate container for your website
-
Create a Custom HTML Tag
- Click Tags in the left sidebar
- Click New to create a new tag
- Choose Custom HTML as the tag type
-
Configure the Tag
- Paste your Dreamdata JavaScript script into the HTML field
- Name your tag (e.g., "Dreamdata Analytics")
-
Set Up Triggering
- Click Triggering and select All Pages
- This ensures the script loads on every page of your website
-
Save and Publish
- Save your tag configuration
- Submit and publish your changes in GTM
Consent Management Platform Integration (GTM Installation)
When using Google Tag Manager, ensure Google Consent Mode v2 is properly configured with your CMP. This allows for compliant tracking based on user consent preferences.
Refer to your CMP's specific Google Consent Mode v2 documentation:
- CookieBot - Google Consent Mode implementation
- CookieYes - Consent Mode with CookieYes
- CookieInformation - GTM tag template setup
- OneTrust - Google Consent Mode v2 setup
- Osano - Consent Mode v2 configuration
Note: Google Consent Mode v2 helps maintain measurement while respecting user privacy choices.
Step 3: Verify Your Installation
After installing the script, it's crucial to verify that Dreamdata Analytics is working correctly. You can verify your installation using:
- Browser Developer Tools - Check network requests and script loading
- Dreamdata App Debugger - View real-time events in your Dreamdata account
For detailed verification instructions, see our debugging guide.
Troubleshooting Common Issues
Script Not Loading
- Verify the script is properly placed in the
<head>
section - Check for JavaScript errors in the browser console
- Ensure your website's Content Security Policy allows the script
No Data in Dreamdata
- Confirm your writeKey matches the one in your Dreamdata account
- Check that the script is firing on page load
GTM Issues
- Ensure the GTM container is published
- Check that the "All Pages" trigger is properly configured
- Verify there are no tag conflicts in GTM
Need Help? If you encounter issues during installation, contact our support team or consult the FAQ section for additional guidance.