Contact support

We reply by e-mail, usually within two days.

Google reCAPTCHA checks this submission against abuse; data is sent to Google. The script loads only when this form is opened. In addition, our own form protection formconfirmed checks it, without passing data to third parties.

← All posts

7 Steps to Implement Stats4U into the Google Tag Manager

About the content and its review

Update, August 2026: the Tag Manager interface in the screenshots below no longer exists, and step 5 — picking document.write — is no longer needed. There is a current version of this guide. The original steps are kept below, reworded but unchanged in substance.

For every site that already has a Google Tag Manager Container embedded!

This article shows how to embed a stats counter from Stats4U into a Google Tag Manager Container. First of all let me describe the different stats counter that we have on our site.


  • 1. The invisible Counter

  • Stats4U offers an invisible counter. On the main page of Stats4U.net it can be picked right away. The choice is between a stats icon that opens the statistics on a click and no icon at all:

  • Historical Stats4U screen with an invisible-counter icon preview beside the HTML embed code.

2. Stats Counter with Visitor count

A real "counter" that increases with each visit is the other option.
A counter with an image produces visible output on the page, wherever the Google Tag Manager Container has been implemented:
Historical Stats4U gallery of digital counter styles beside the HTML embed code.
We recommend the first option with the Google Tag Manager, because the GTM can sit in various places and the position of the Stats image cannot be controlled.

Pass the code to the Tag Manager

Once the counter style is picked, the code goes straight into the Google Tag Manager.
1. Copy the desired code:
Historical Stats4U screen with the counter's HTML embed code selected for copying.
2. Create a new Tag in the Container
Historical Google Tag Manager screen showing the New tag button.
3. Choose "Custom HTML Code":
Historical Google Tag Manager screen showing the Custom HTML tag option.
4. Paste the copied Stats4U Code into the Tag

Historical Google Tag Manager HTML editor containing the Stats4U counter code.
5. Pick document write
Historical Google Tag Manager screen with document.write support enabled; this option is no longer needed.
6. Select firing rule "All pages"
Historical Google Tag Manager screen with the All Pages firing trigger selected.
7. Save & Publish!
Historical Google Tag Manager screen showing the Publish button and the Stats4U tag row.
Ready and set up! The counter is now tracking the visitors on the site.
Check back on our blog for more insights and features in the future!
Advertisement