Accessing Tag Management
- Go to Dashboard → [Your Workspace] → Settings
- Click the Container tab
- View all active and inactive tags
- Click Add New Tag to create a tag
Tag Types
Inline Script
Execute custom JavaScript code directly on your pages. Use Cases:- Track button clicks
- Monitor form submissions
- Custom event tracking
- DOM manipulation
- Analytics events
External Script
Load external JavaScript files from third-party services. Use Cases:- Analytics platforms
- Chat widgets
- Heatmap tools
- A/B testing scripts
- Third-party integrations
Tracking Pixel
Fire tracking pixels (image requests) for conversion tracking. Use Cases:- Conversion tracking
- Retargeting pixels
- Affiliate tracking
- Custom pixel endpoints
Creating a Tag
Step 1: Basic Information
Tag Name Give your tag a descriptive name (e.g., “Meta Pixel - Homepage”, “Chat Widget”, “Scroll Tracker”). Tag Type Choose from Inline Script, External Script, or Tracking Pixel. Status Set to Active to enable immediately, or Inactive to save as draft.Step 2: Configure Content
For Inline Scripts: Write your JavaScript code in the code editor. Use built-in variables for dynamic values. For External Scripts: Enter the full URL to the external JavaScript file (must start withhttps://).
For Tracking Pixels:
Enter the pixel URL with any query parameters for conversion data.
Step 3: Set Triggers
Choose when your tag fires: Page Load Fire when the page first loads (before DOM is ready). DOM Ready Fire when the DOM is fully loaded (recommended for most tags). History Change Fire when navigation changes in SPAs (React, Vue, Next.js). Scroll Fire when user scrolls past 100px down the page. Visibility Change Fire when browser tab becomes visible after being hidden.Step 4: Set Firing Frequency
Control how often the tag executes: Always Fire every time the trigger occurs. Use for analytics and tracking. Once per Page Fire only once per page load. Use for pixels and one-time scripts. Once per Session Fire once per browser session (survives across pages). Use for session-level tracking.Step 5: Add Conditions (Optional)
Add conditions to control when the tag fires:URL Path Conditions
Match specific pages or patterns: EqualsQuery Parameter Conditions
Check for specific parameters: ExistsReferrer Conditions
Target traffic from specific sources: ContainsDevice Conditions
Target specific device types: Mobile Fires on mobile devices only. Tablet Fires on tablets only. Desktop Fires on desktop only.Custom JavaScript
Write custom logic:true to fire the tag, false to block it.
Step 6: Use Built-In Variables
Use dynamic variables in your tags: Page Variables:{{Page URL}}: Full page URL{{Page Path}}: URL path only{{Page Hostname}}: Domain name{{Page Title}}: Document title{{Referrer}}: Referrer URL
{{UTM Source}}: utm_source parameter{{UTM Medium}}: utm_medium parameter{{UTM Campaign}}: utm_campaign parameter{{UTM Term}}: utm_term parameter{{UTM Content}}: utm_content parameter
{{Query String}}: Full query string{{Fragment}}: URL hash{{User Agent}}: Browser user agent{{Timestamp}}: Current ISO timestamp{{Random Number}}: Random number (0-1){{Screen Resolution}}: Screen width x height{{Viewport Size}}: Viewport width x height{{Language}}: Browser language
Common Tag Examples
Meta Pixel Conversion Tracking
Type: Inline Script Trigger: DOM Ready Frequency: Once per Page Conditions: URL path equals/thank-you
Button Click Tracking
Type: Inline Script Trigger: DOM Ready Frequency: AlwaysExit Intent Popup
Type: Inline Script Trigger: DOM Ready Frequency: Once per Session Conditions: Device equals DesktopScroll Depth Tracking
Type: Inline Script Trigger: Scroll Frequency: Once per PageSPA Page View Tracking
Type: Inline Script Trigger: History Change Frequency: AlwaysConditional Chat Widget
Type: External Script Trigger: DOM Ready Frequency: Once per Page Conditions: URL path starts with/support/
Managing Existing Tags
Edit a Tag
- Find the tag in your Container list
- Click Edit
- Make changes
- Click Save
Pause a Tag
- Click the toggle next to the tag name
- Tag changes to Inactive
- Tag stops firing immediately
Delete a Tag
- Click Delete next to the tag
- Confirm deletion
- Tag is permanently removed
Testing Tags
Enable Debug Mode
Add?datalyr_debug=true to your URL to see console logs:
[DATALYR Container] Script fired: Your Tag Name- Tag execution details
- Condition matching results
Check Network Requests
- Open DevTools → Network tab
- Filter by your external script domain or pixel URL
- Verify requests are being sent
Test Conditions
Use debug mode to see why tags fire or don’t fire:Tag Priority and Loading
Tags load and execute in order:- page_load triggers fire first
- dom_ready triggers fire after DOM loads
- history_change triggers fire on SPA navigation
- scroll and visibility_change fire when triggered
Best Practices
Name tags clearly Use descriptive names: “Meta Pixel - Purchase Event” not “Pixel 1”. Use appropriate triggers Most tags should use DOM Ready unless they need to fire earlier. Set firing frequency correctly Use Once per Page for conversion pixels to avoid duplicate fires. Test with conditions Start with a test page condition before rolling out site-wide. Limit active tags Keep under 50 active tags for best performance. Use built-in variables Avoid hardcoding values that change (URLs, campaigns, etc.). Monitor errors Check container errors:window.DATALYR.container.getErrors()
Troubleshooting
Tag not firing? Check:- Tag is Active (not Inactive)
- Trigger matches current page state
- Conditions are met (test with debug mode)
- External script URL is valid (https:// required)
- Ad blockers are disabled
{{Page URL}} (case-sensitive, with spaces and double braces).
Conditions not working?
Enable debug mode to see condition evaluation:
Next Steps
Container Installation
Install container script
Container Overview
Learn about Container features
Container vs Direct
Compare installation methods
Integrations
Connect ad platforms