hie webmasters..
recently i due to server crash i chnged d server of my site..
after the changes my google analytic is showing zero visitors since one week..
help me out..!!should i reinstal the tracking code..??

Dani AI

Generated

Most zero-visit reports after a server move come down to one of three things: the tracking snippet is missing or wrong in the HTML the server now serves, the hits are being filtered or sent to a different property/view, or the tracking requests are blocked (caching, mixed‑content, firewall, adblock). is correct that a server move itself doesn’t disable Analytics — it’s what changed in the files or serving behavior that matters. and were also on the right track about re-adding a fresh snippet, but that alone isn’t enough without a few checks.

Minimal checklist to resolve this fast

  • Open a live page from the new server, choose View Source (or Inspect) and search for UA- or G- and for ga(, gtag( or _gaq. If nothing shows, the snippet is missing.
  • Confirm the tracking ID in the snippet exactly matches the property you are viewing in Google Analytics. Using the wrong ID will send hits elsewhere.
  • Use the browser DevTools Network tab and filter for google-analytics / googletagmanager or for requests to collect to confirm the browser actually makes the analytics request. This verifies the tag is loaded and not blocked by mixed content, a CSP, or a firewall.
  • Check the Analytics view configuration: selected view, date range, and any filters (hostname or IP) that might exclude all traffic. A restrictive filter will produce zero data even when the tag is firing.
  • Verify the page returns HTTP 200 (not a maintenance/redirect page) and clear any CDN or server cache that might be serving old files.

If re-adding the tag is needed, use the appropriate snippet for your property (examples below). Do not add a second property blindly — that splits or confuses data. If the above checks pass but no hits appear, test from another network or device (to avoid your IP being excluded) and re-create the property only as a last resort.

Example snippets (replace the IDs)

<!-- gtag.js (GA4) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-XXXXXXX');
</script>

<!-- analytics.js (Universal) -->
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-XXXXXXX-X', 'auto');
  ga('send', 'pageview');
</script>

These steps resolve almost every server-move tracking problem.

Recommended Answers

All 7 Replies

Moving web pages from one server to another does not alter Analytics ability to track your web pages. You need to physically remove the code from the web pages to accomplish this.

how can i remove the code from webpages ...?

You can remove a snippet of code within the <head> of the HTML document using an HTML editor or text editor. Save it then replace the old file on the server.

there is another problem in your analytics , generate the code again and put it into your site

ok..
thanks all for their suggestions..

i think its better to apply another analytics code o nthe web site to save the time

You have to reamove code and again put fresh code in your pages.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.