Skip to content

wo123kr/te_gtm_template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Thinking Engine - All-in-One GTM Template

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.

License GTM Template Gallery

✨ Features

🎯 One Template, All Features

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

🎨 Enhanced User Experience

  • 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

πŸ“‹ Supported Tag Types

πŸš€ Initialization

  • SDK initialization with customizable configuration
  • Auto-tracking settings (pageview, page show/hide)
  • Debug logging controls

πŸ“Š Event Tracking

  • 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

πŸ‘€ User Management

  • Login/Logout (login, logout): User session management
  • Guest ID (setDistinctId): Anonymous user tracking
  • User Properties:
    • userSet: Set/update user attributes
    • userSetOnce: Set attributes only once
    • userAdd: Increment numeric attributes
    • userUnset: Remove specific attribute values
    • userDel: Delete multiple attributes
    • userDelete: Remove all user attributes
    • userAppend: Add values to array attributes
    • userUniqAppend: Add unique values to arrays

🌍 Properties Management

  • Global Properties (setSuperProperties): Apply to all events
  • Remove Global Properties (unsetSuperProperties, clearSuperProperties)
  • Page Properties (setPageProperty): Page-specific context

πŸ› οΈ Installation & Usage

1. Import Template

  1. In Google Tag Manager, go to Templates β†’ Tag Templates
  2. Click New β†’ Import
  3. Select the Thinking Engine.tpl file
  4. Save the template

2. Create SDK Initialization Tag

  1. Create a new tag using the "Thinking Engine" template
  2. Select πŸš€ μ΄ˆκΈ°ν™” (init) as tag type
  3. Configure required settings:
    • App ID: Your Thinking Engine project ID
    • Server URL: Data collection endpoint (use default)
    • Instance Name: SDK instance name (default: "ta")
  4. Set trigger to fire on all pages
  5. Save and Submit

3. Create Event Tracking Tags

  1. Create additional tags for specific events
  2. Select appropriate tag type (track, login, userSet, etc.)
  3. Configure event-specific parameters
  4. Set appropriate triggers
  5. Save and Submit

πŸ“– Configuration Examples

Basic Event Tracking

Tag Type: πŸ“Š κΈ°λ³Έ 이벀트 전솑 (track)
Event Name: button_click
Event Properties:
  - button_id: "cta_button"
  - page_section: "header"

User Login

Tag Type: πŸ‘€ 둜그인 (login)
Account ID: {{User ID Variable}}

User Properties

Tag Type: βš™οΈ μ‚¬μš©μž 속성 μ„€μ • (userSet)
User Properties:
  - membership_level: "premium"
  - preferred_language: "ko"

Global Properties

Tag Type: 🌍 곡톡 속성 μ„€μ • (setSuperProperties)
Global Properties:
  - app_version: "2.1.0"
  - platform: "web"

πŸ”§ Advanced Features

First-time Event Tracking

Prevent duplicate tracking of important one-time actions:

Tag Type: πŸ“Š 졜초 이벀트 (trackFirst)
Event Name: app_install
First Check ID: {{User ID}} (optional)

Time-based Tracking

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)

Page-specific Properties

Set context that applies only to current page:

Tag Type: 🌍 νŽ˜μ΄μ§€ 곡톡 속성 μ„€μ • (setPageProperty)
Page Properties:
  - page_category: "product"
  - content_type: "detail"

🎯 Best Practices

1. Initialization First

  • Always create and deploy the initialization tag before any tracking tags
  • Use the same instance name across all tags

2. Organized Naming

  • Use clear, consistent event names (e.g., button_click, page_view)
  • Follow naming conventions: lowercase with underscores

3. Property Management

  • Use global properties for app-wide context (version, platform)
  • Use page properties for page-specific context
  • Use user properties for user-specific attributes

4. Testing & Debugging

  • Enable debug logging during development
  • Test in Preview mode before publishing
  • Verify data in Thinking Engine dashboard

πŸ” Troubleshooting

Common Issues

"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

πŸ“š Additional Resources

🀝 Contributing

Contributions are welcome! Please feel free to submit issues and enhancement requests.

πŸ“„ License

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

About

Google Tag Manager custom template for ThinkingData (ThinkingEngine) SDK integration

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors