Jump to content

Tracking Hits Across Many Generated Sites, Each Individually

From Babylon SIGNALIS Wiki

Tracking hits across many generated sites, each individually


Anyone who builds sites from a generator meets the same problem sooner or later: every site needs a counter, and the simple answer is to insert one common snippet into the template. It works on the first day. It also means each site carries one identifier, reports into a common account and can be linked to its neighbours by anyone who looks at the source. What follows is how to assign each site its own counter without converting the setup into a manual chore.


The counting setup belongs in the build, not in a browser tab. A generator that can call an interface can add a site, receive its snippet, embed it at build time and later read the totals back, all without anyone opening a console. The counter becomes another build output, like the sitemap, and it is created and removed together with the site.


Where the data resides matters even more at this scale. If every counter sends into a third-party account, the information for all your sites sits in one place you do not manage. If each site counts into the hosting account it already operates on, the data stays with the site, including when that account belongs to a client rather than to you.


A common snippet is convenient because it is one line, and that is precisely its cost. The same tracking identifier on a hundred sites is a fingerprint: it shows that they are linked, and it puts all their visitors into one group that you then have to split by hand. When one site is sold, given to a client or taken down, its history is tangled with everyone else's.


The tidier approach is a distinct counter per site, created at the moment the site appears. Each one has its own script, reports independently and can be deleted on its own, and nothing in the page source of one site points to the others. The challenge has always been the administration, not the concept.


With clx this works through an open API. A site is added with one call, the snippet comes back ready to embed during the build, the counter runs as a worker in the Cloudflare account that hosts the site, and the totals are read through the same interface, so the whole cycle fits into the generator.


The same requests handle short links and their codes, so a generator that already builds sites can also give each of them its own short addresses on its own domain, with no overlap between them.



The requests, the sequence they come in and what each one returns: traffic distribution and site analytics


Briefly


Records maintained with the hosting stay put when the property switches hands.
Doing that setup inside the build, through an interface, removes the manual work that made the shared line appealing.
With one per property, each record stays separate and can be removed individually.