How To Add Counter Code

Table of contents:

How To Add Counter Code
How To Add Counter Code

Video: How To Add Counter Code

Video: How To Add Counter Code
Video: Simple Counter | Javascript Beginner Project Tutorial 2024, November
Anonim

The counter code that you received through the system for counting site visitors must be added to the code of the pages on which you want to display statistics. Also, some hit counters only count users who viewed pages with the counter embedded code. You can add a counter code in the following ways.

How to add counter code
How to add counter code

Instructions

Step 1

The resource visitor counter code - canter (counter) - that you received from any service for counting site visitors (for example, HotLog, 24Log, Rating Openstat, LiveInternet, etc.) is a script with a client ID. Such a script usually contains about 10 lines of code and begins with an auxiliary word, for example. To set a counter on the pages of a static site made in bare HTML, you need to add the counter code (script) to all pages, while using tags like

for line feed and,, for alignment. This is especially important if the counter banner will end up in a table cell. The code can be added both through an online or offline HTML editor, as well as through Notepad, NotePad ++ and other text editors.

Step 2

With sites built on management systems - CMS - everything is much easier. In WordPress, DataLife Engine, Joomla and other content management systems, you can add widgets or modules by placing them in a specific column on the site pages. Having created the widget once and placed the counter code in it, it will be displayed on all pages of the site to which the standard template is applied.

Step 3

Also, you can put the HTML code of the counter in one of the basic PHP pages in the CMS internal editor. For example, to the file footer.php or page.php. The counter is duplicated on all pages of the site.

Step 4

In the popular free content management system uCoz, for a one-time addition of a block with a visitor counter, go to the site under the administrator's login and launch the constructor in the top panel. After that, select the "Add block" item in the admin panel, drag it to the place you need and click on the gear icon. In the window that appears, select the HTML tab and add the script code to it, then click "Save", and also save the changes in the admin panel (section "Constructor"). Also in the control panel of the site uCoz offers its own visit counters.

Recommended: