How to Add a Hit Counter to Blogger

Blogger makes it easy to add a hit counter to your blog: its HTML/JavaScript gadget accepts third-party scripts, so you do not need to edit your theme. This guide shows how to place a visible GNRCounter in your sidebar or footer, how to add hidden tracking to every page through the theme, and how the result differs from Blogger’s built-in stats.

Blogger stats vs a separate counter

Blogger already shows pageview figures in its Stats section and offers a pageviews gadget. These numbers are useful, but they are counted by Blogger with its own rules and stay inside your Blogger account. A separate counter gives you a second, independent view of your traffic with reports for visitors, page views, online users, popular posts, referring sites and visitor countries in one dashboard. Because each tool filters and counts visits differently, expect the totals to differ. Treat each as a consistent trend line rather than an exact census.

1. Create your counter

Open Create your free counter and enter your blog’s address without a post path, for example myblog.blogspot.com or your custom domain if you use one. Use the address visitors actually see. Choose your country and the timezone in which you want each day to start and end, then pick the counter language.

Next, choose the display type. Text shows the statistics you select, such as online users, today’s visitors or total visitors, in the colours you choose. Hidden records activity without showing anything on the page. Submit the form, copy the embed code and keep your private management link safe.

2. Add a visible counter with the HTML/JavaScript gadget

  1. Sign in to Blogger and select your blog.
  2. Open Layout in the left menu.
  3. In the section where the counter should appear, usually Sidebar or Footer, click Add a Gadget.
  4. Choose HTML/JavaScript.
  5. Enter an optional title, such as “Visitors”, and paste the full GNRCounter code into the Content box.
  6. Click Save. You can drag the gadget up or down within its section to change its position.

The counter is drawn where the gadget sits, so its position in the layout is its position on the page. Gadgets in the sidebar and footer appear on posts, pages and the home page, which means one gadget is normally enough for the whole blog.

3. Check the mobile view

Current Blogger themes such as Contempo, Soho, Emporio, Notable and Essential are responsive, and their sidebar gadgets usually move below the content on phones. Some older themes use a separate mobile template that shows fewer gadgets. If your counter appears on desktop but not on your phone, open Theme, look at the mobile settings for your theme and check whether the desktop layout or all gadgets can be shown on mobile. If you rely on a hidden counter, the theme method below avoids this problem altogether.

4. Add hidden tracking through the theme

For hidden tracking on every page, independent of gadgets, you can place the code in the theme itself.

  1. Open Theme and click the arrow next to Customize, then choose Backup and download a copy of your theme first.
  2. From the same menu choose Edit HTML.
  3. Use the editor’s search (click inside the editor and press Ctrl+F or Cmd+F) to find </body>.
  4. Paste the GNRCounter code on the line directly above </body>.
  5. Click the save icon.

Blogger themes are XML files. If the editor reports an error when you save, check that you pasted the complete code and that nothing was cut off. Do not use this method for a visible text counter, because the display would appear at the very bottom of the page, after the footer.

5. Do not add the code twice

Use either the gadget or the theme method for a given counter, not both. Two copies of the code on the same page can record the same view twice and show two displays. If you change from a visible counter to hidden tracking, remove the old gadget when you add the code to the theme.

6. Check that it works

View your blog in a private browser window, open a post and then the home page. For a text counter, check that the numbers are readable against your theme’s background and do not overflow a narrow sidebar. Then open your report link, confirm the timezone and look at today’s activity. Privacy extensions and ad blockers in your own browser can block the request, so test in a clean browser profile if your visit does not appear.

Tips for a tidy counter

  • Show fewer numbers: two or three statistics are easier to read than a long list. Online users and total visitors are a common pair.
  • Match your theme: pick background and text colours with clear contrast; a transparent-looking white background often blends best in light themes.
  • Avoid your own visits: regularly refreshing your own posts inflates the totals. Read your blog while signed out or in a separate browser if you want cleaner figures.
  • Keep the starting count honest: a starting value continues a visible total but does not create historical reports, so do not present it as verified visitors.

Common problems

  • The gadget shows the code as text: you used a Text gadget instead of HTML/JavaScript.
  • Nothing appears on mobile: your theme’s mobile view hides the gadget; adjust the theme’s mobile settings or use hidden tracking in the theme.
  • The counter shows on a custom domain but no data appears: make sure the domain you registered matches the address visitors use.
  • The theme will not save: the pasted code is incomplete; restore your backup if needed and paste it again.

Privacy and next steps

Blogger shows its own cookie notice to visitors from some regions, but that notice covers Google’s services, not third-party tools you add. Mention the counter in your blog’s privacy page and obtain consent where your visitors’ laws require it. Our privacy policy explains the data the counter handles. When your first numbers arrive, unique visitors vs page views explains how to read them, and the traffic sources guide shows where your readers come from. For more tutorials, browse all guides.

All guides Back to homepage