Google Tag Manager Installation
Installing TrackFox through Google Tag Manager (GTM) allows you to manage your tracking script alongside other marketing tools. This method is ideal for websites that already use GTM for analytics and marketing tags.
Prerequisites
Prerequisites: You need to have Google Tag Manager already installed on your website and access to your GTM container.
Step 1: Get Your Tracking Script
- Log in to your TrackFox dashboard
- Click on the website dropdown in the top navigation
- Select "Site Settings" from the dropdown menu
- In the General tab, copy your unique tracking script
Your tracking script will look like this:
<script
defer
src="https://trackfox.app/script.js"
data-website-id="your-website-id-here"
data-domain="yourdomain.com"
></script>
Step 2: Create a Custom HTML Tag in GTM
- Open your Google Tag Manager container
- Click on "Tags" in the left sidebar
- Click the "New" button to create a new tag
- Click on "Tag Configuration" and select "Custom HTML"
- Paste your TrackFox tracking script into the HTML field
- Name your tag (e.g., "TrackFox Tracking Script")
Step 3: Configure the Trigger
- Click on "Triggering" in the tag configuration
- Select "All Pages" trigger (or create a custom trigger if needed)
- This ensures the TrackFox script loads on every page
Step 4: Test and Publish
- Click "Save" to save your tag
- Use GTM's "Preview" mode to test the tag on your website
- Verify that the TrackFox script is firing correctly
- Once tested, click "Submit" to publish your changes
- Add a version name and description, then click "Publish"
Verify Installation
After publishing, return to your TrackFox dashboard and use the "Verify Installation" button in Site Settings to confirm your tracking script is working properly.
Advanced: Custom Event Tracking
Once your base tracking is set up, you can create additional GTM tags for custom events like purchases or conversions:
// Example: Track payment events through GTM
window?.trackfox("payment", {
email: "customer@example.com",
amnt: 2999, // $29.99 in cents
});
Important Notes
Important: When using GTM, make sure the TrackFox script loads before any custom event tracking tags. You can set tag firing order in GTM's advanced settings if needed.
Best Practices
- Test thoroughly: Always use GTM's preview mode before publishing
- Monitor performance: Keep an eye on tag firing and any errors
- Organize tags: Use clear naming conventions for your tags
- Document changes: Add descriptive version names when publishing
Troubleshooting
Tag Not Firing
If your TrackFox tag isn't firing:
- Check that the trigger is set to "All Pages"
- Verify the tag is published and active
- Use GTM's preview mode to debug
- Check for JavaScript errors in the browser console
Script Not Loading
If the script isn't loading:
- Verify the HTML is correctly formatted
- Check that GTM is properly installed on your website
- Ensure there are no conflicts with other tags
- Test in an incognito window to rule out caching issues
Next Steps
Now that you have TrackFox installed through GTM:
Need help? Contact us for assistance.
Suggest features? We'd love your feedback