Skip to main content

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

  1. Log in to your Dreamdata account
  2. Navigate to Data Platform > Sources > JavaScript v2.0
  3. 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

  1. Copy the JavaScript script from your Dreamdata account
  2. Paste the script within the <head> section of your website's HTML code
  3. Ensure the script is placed before the closing </head> tag
  4. Save and deploy your changes
<head>
<!-- Other head elements -->

<!-- Dreamdata Analytics Script -->
// Your Dreamdata script goes here
</head>

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:

Important: Test your CMP integration thoroughly to ensure tracking works correctly with user consent preferences.

Option B: Google Tag Manager Installation

  1. Access Google Tag Manager

    • Log in to your Google Tag Manager account
    • Select the appropriate container for your website
  2. 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
  3. Configure the Tag

    • Paste your Dreamdata JavaScript script into the HTML field
    • Name your tag (e.g., "Dreamdata Analytics")
  4. Set Up Triggering

    • Click Triggering and select All Pages
    • This ensures the script loads on every page of your website
  5. Save and Publish

    • Save your tag configuration
    • Submit and publish your changes in GTM

Google Tag Manager Custom HTML Tag Setup

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:

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:

  1. Browser Developer Tools - Check network requests and script loading
  2. 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.