Google Tag Manager (GTM)

Your Workspace Id

You can find your Workspace Id on your Workspace's settings page. It should start with "ws_".

Installing Spectacle with Google Tag Manager

The Spectacle GTM template provides a complete analytics integration without requiring manual code implementation. You can track page views, identify users, record events, and link users to organizations through Google Tag Manager's interface.

Before you begin

  1. Get your Workspace Id: Find your Workspace Id on your Workspace's settings page
  2. Access to GTM: Ensure you have admin access to your Google Tag Manager container
  3. Plan your tracking: Consider what events you want to track and when they should fire

Step 1: Import the Spectacle GTM Template

  1. In Google Tag Manager, go to Templates in the left sidebar
  2. Click Search Gallery in the Tag Templates section
  3. Search for "Spectacle" and select the official Spectacle template
  4. Click Add to workspace to import the template

Step 2: Create a Spectacle Tag

  1. Go to Tags and click New
  2. Click Tag Configuration and select Spectacle from the Custom templates section
  3. Configure your tag based on your tracking needs:

Required Configuration

  • Workspace Id: Enter your Workspace Id (starts with "ws_")
  • Spectacle Method: Choose from four tracking methods:
    • Page: Track page views (recommended for most sites)
    • Identify: Identify users with traits
    • Track: Track custom events
    • Group: Associate users with organizations

Method-Specific Configuration

Page Method (Automatic Page Tracking)

No additional configuration needed. The template automatically collects page URL, title, referrer information, UTM parameters, and device data.

Advanced Options
  • Auto Track Forms: Automatically track form submissions as Identify events (when an email is found in form data) and as Track events. This option is enabled by default.

Identify Method (User Identification)

  • User Id (required if no Email): Unique identifier for the user
  • Email (required if no User Id): User's email address
  • First Name: User's first name
  • Last Name: User's last name
  • User Traits: Additional custom properties (key-value pairs)

Track Method (Custom Event Tracking)

  • Event Name (required): Name of the event (e.g., "Trial Started", "Form Submitted")
  • Revenue: The revenue in cents associated with this event (e.g., 19999 for $199.99)
  • Currency: The three letter currency code (e.g., "EUR" or "USD")
  • Event Properties: Custom event data (key-value pairs)

Group Method (Organization Association)

  • Group Id (required): Unique identifier for the organization
  • Group Traits: Organization properties (key-value pairs)

Step 3: Configure Triggers

Set up triggers to determine when your Spectacle tags should fire:

For Page Tracking

  • Trigger Type: Page View
  • Trigger Fires On: All Pages (or specific pages as needed)

For User Identification

  • Trigger Type: Custom Event or Page View
  • Trigger Fires On: When user data is available (e.g., after login)

For Event Tracking

  • Trigger Type: Click, Form Submission, Custom Event, etc.
  • Trigger Fires On: When the specific action occurs

For Group Association

  • Trigger Type: Custom Event or Page View
  • Trigger Fires On: When organization data is available

Step 4: Test Your Implementation

  1. Preview Mode: Use GTM's Preview mode to test your tags
  2. Debug Mode: Enable Debug Mode in the Spectacle tag to see console logs
  3. Check Firing: Verify that tags fire on the correct triggers
  4. Validate Data: Ensure the correct data is being sent to Spectacle

Step 5: Publish Your Changes

Once testing is complete:

  1. Click Submit in GTM
  2. Add a descriptive version name and description
  3. Click Publish to make your changes live

Common Use Cases

Basic Website Tracking

Create a tag with Method: Page and Trigger: All Pages

Lead Generation Tracking

Create a tag with Method: Track, Event Name: "Lead Generated", and appropriate form submission triggers

E-commerce Conversion Tracking

Create a tag with Method: Track, Event Name: "Purchase", include revenue and currency properties

User Identification After Login

Create a tag with Method: Identify, include User Id and email, trigger on login success

Revenue Tracking

For revenue events, include revenue and currency properties in your Track events. Spectacle will automatically use this data for ROAS calculations on your dashboard.

Troubleshooting

Tag Not Firing

  • Check trigger configuration
  • Verify trigger conditions are met
  • Use GTM Preview mode to debug

Data Not Appearing

  • Confirm Workspace Id is correct
  • Check browser console for errors (enable Debug Mode)
  • Verify network requests are being made

Next Steps

Once your GTM implementation is live:

  1. Monitor your Spectacle dashboard for incoming data
  2. Set up additional events as needed
  3. Configure attribution models and reporting preferences