A comprehensive Google Tag Manager template for the Thinking Engine JavaScript SDK that combines initialization and all event tracking features in a single, user-friendly template.
Unlike traditional templates that require separate initialization and event tags, this all-in-one template provides:
- π SDK Initialization: Complete SDK setup with advanced configuration options
- π Event Tracking: All types of event tracking in one place
- π€ User Management: Comprehensive user identification and attribute management
- π Properties Management: Global and page-specific property handling
- π§ Advanced Features: Time tracking, first-time events, and data operations
- Intuitive UI: Emoji-coded categories and clear field descriptions
- Smart Validation: Real-time input validation with helpful error messages
- Contextual Help: Detailed explanations and examples for each feature
- Organized Sections: Logical grouping with collapsible sections
- SDK initialization with customizable configuration
- Auto-tracking settings (pageview, page show/hide)
- Debug logging controls
- Basic Events (
track): Standard event transmission - First-time Events (
trackFirst): Prevent duplicate first-time actions - Update Events (
trackUpdate): Modify existing events - Overwrite Events (
trackOverwrite): Replace event data completely - Time Events (
timeEvent): Start timing for duration measurement
- Login/Logout (
login,logout): User session management - Guest ID (
setDistinctId): Anonymous user tracking - User Properties:
userSet: Set/update user attributesuserSetOnce: Set attributes only onceuserAdd: Increment numeric attributesuserUnset: Remove specific attribute valuesuserDel: Delete multiple attributesuserDelete: Remove all user attributesuserAppend: Add values to array attributesuserUniqAppend: Add unique values to arrays
- Global Properties (
setSuperProperties): Apply to all events - Remove Global Properties (
unsetSuperProperties,clearSuperProperties) - Page Properties (
setPageProperty): Page-specific context
- In Google Tag Manager, go to Templates β Tag Templates
- Click New β Import
- Select the
Thinking Engine.tplfile - Save the template
- Create a new tag using the "Thinking Engine" template
- Select π μ΄κΈ°ν (init) as tag type
- Configure required settings:
- App ID: Your Thinking Engine project ID
- Server URL: Data collection endpoint (use default)
- Instance Name: SDK instance name (default: "ta")
- Set trigger to fire on all pages
- Save and Submit
- Create additional tags for specific events
- Select appropriate tag type (track, login, userSet, etc.)
- Configure event-specific parameters
- Set appropriate triggers
- Save and Submit
Tag Type: π κΈ°λ³Έ μ΄λ²€νΈ μ μ‘ (track)
Event Name: button_click
Event Properties:
- button_id: "cta_button"
- page_section: "header"
Tag Type: π€ λ‘κ·ΈμΈ (login)
Account ID: {{User ID Variable}}
Tag Type: βοΈ μ¬μ©μ μμ± μ€μ (userSet)
User Properties:
- membership_level: "premium"
- preferred_language: "ko"
Tag Type: π κ³΅ν΅ μμ± μ€μ (setSuperProperties)
Global Properties:
- app_version: "2.1.0"
- platform: "web"
Prevent duplicate tracking of important one-time actions:
Tag Type: π μ΅μ΄ μ΄λ²€νΈ (trackFirst)
Event Name: app_install
First Check ID: {{User ID}} (optional)
Measure duration between events:
1. Start timing: Tag Type: π μ΄λ²€νΈ μκ°μΈ‘μ (timeEvent)
Event Name: video_play
2. Send timed event: Tag Type: π κΈ°λ³Έ μ΄λ²€νΈ μ μ‘ (track)
Event Name: video_play
(Duration will be automatically included)
Set context that applies only to current page:
Tag Type: π νμ΄μ§ κ³΅ν΅ μμ± μ€μ (setPageProperty)
Page Properties:
- page_category: "product"
- content_type: "detail"
- Always create and deploy the initialization tag before any tracking tags
- Use the same instance name across all tags
- Use clear, consistent event names (e.g.,
button_click,page_view) - Follow naming conventions: lowercase with underscores
- Use global properties for app-wide context (version, platform)
- Use page properties for page-specific context
- Use user properties for user-specific attributes
- Enable debug logging during development
- Test in Preview mode before publishing
- Verify data in Thinking Engine dashboard
"SDK not found" Error
- Ensure initialization tag fires before tracking tags
- Check that the same instance name is used across all tags
- Verify App ID and server URL are correct
Events Not Appearing
- Check network tab for successful API calls
- Verify event name follows naming conventions
- Enable debug logging to see detailed execution logs
Validation Errors
- Review error messages for specific field requirements
- Ensure required fields are populated
- Check data formats match expected patterns
Contributions are welcome! Please feel free to submit issues and enhancement requests.
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
Template Version: 2.0.0
Compatible with: Thinking Engine JavaScript SDK
GTM Template API Version: Latest