Visitors

From Contao Community Documentation

Revision as of 22:20, 12 September 2010 by BugBuster (Talk | contribs)

I'm not a native English speaker. Please correct my mistakes.

Stub.png Incomplete Article: This article is not finished yet and needs expansion.

Please expand it and remove this notice when it is finished.


Visitors
This module allows you to count hits and visits of your website.

In the display appears the hits and visits from the current day, as well as the respective total. Statistic is also in the backend.


Extension-Overview
Name of the developer Glen Langer (BugBuster)
Developer Website http://www.contao.glen-langer.de
Version of the extension 2.1.0 rc1
Compatibility with Contao Version from 2.9
Compatibility with TYPOlight Version 2.7.0 - 2.8.4 (see installation notes)
Link to Extension Repository http://www.contao.org/extension-list/view/visitors.en.html
Donate the developer Cappuccino
Link to Tracker http://dev.typolight-forge.org/projects/visitors/issues
Depending of ff. Extension Bot Detection
Comment Version for Contao 2.9 online

Forum

Questions about the Visitors module will be answered in forum: Forum
Errors and requests can be reported in the Issue Tracker.


Installation

The installation of the module occurs about the extension Repository in back end of Contao.
A manual installation is possible. Download the ZIP file from Extension Repository, unzip and transfer it.
A directory should have been created "/system/modules/visitors".
Then call /contao/install.php - Perform Update Database.
( /typolight/install.php in older TYPOlight installations )

The module Visitors is dependent on the module "Bot Detection". It must therefore be installed with manual installation.


Note for older "TYPOlight" versions

TYPOlight 2.8

Users of TYPOlight 2.8.x, please use Visitors Modul Version 1.7.1 (Direct Link)

TYPOlight 2.7

Users of TYPOlight 2.7.x, please use Visitors Modul Version 1.4.1 (Direct Link)

Update version 1.x to version 2.x

Caution.png Caution: Version 2.x is not fully compatible with previous versions, an update is possible.


What is to be observed, can be found here.


Overview

The Visitors module contains two back end and one front end module.
In the back end, there are "Visitors" and "Visitor Statistics", for the front end "Visitors".


Back end

(Images will be filed later.)

Visitors

Datei:Visitors_de_backend_besucher.jpg

Visitors Statistics

Datei:Visitors_de_backend_besucherstatistik.jpg

shows in detail: (Click on image for higher resolution)

Front end

For the front end are provided two CSS files as an example:

  • mod_visitors_fe.css for the normal output, line by line
  • mod_visitors_fe_horizontal.css for the horizontal output

Visitors Statistics

Datei:Modul_visitors_fe_all.jpg

Visitors Statistics, horizontal

Datei:Modul_visitors_fe_all_horizontal.jpg


Using

The first one creates a new visitor category via the menu item "visitors". In this then the counter.
Then, create a front end module and build it into the layout of the page.
Here are the steps, each with the default values. Technical details will be explained later.

Create the category

To create a new category, just click on the left in the back end in 'content' to 'Visitors'. In the main area click on the button 'New category'.
Datei:Visitors_de_backend_kategorie_neu.jpg
There, enter the name of the category. The front end module will later use this name. Then you click on "Save and close".
Now you can see the category overview. By clicking on the pencil in the line of the category and repeated clicking on the pencil in the head of the category you return to the settings of the category.


Create new counter

In the category list now clicking on Edit (pencil) of the category.
Now, either click the 'New counter' and then the arrow icon, or click the plus in the head of the category:
Datei:Visitors_de_backend_besucherzaehler_neu.jpg

Now, some information are needed: :

  • Name, (is displayed as a heading on the numbers).
  • Start date, optional, only for display in font end
  • Optional: 'Initial value of visitors/hits'
  • Optional: 'Visitors per day'
  • Activate "Published"

Then you click on "Save and close".

Front end Module

A new front-end module is create with:

  • Layout -> Themes -> Modules -> Add module (Contao 2.9)
  • Layout -> Modules -> Add module (TYPOlight 2.8.x)


At first, enter the title, and only then select in "Module type": 'Miscellaneous'-'Visitors'. It changes the form fields.
In 'Visitors category' now select the previously created category, then 'Save and close'.

Now, the front end module must be included in the layout:

  • Layout -> Themes -> Layout -> Edit the used layout (Contao 2.9 and newer)
  • Layout -> Page layout -> Edit the used layout (TYPOlight 2.8.x)

Include in 'Included modules' the just-created front end module (e.g. to left)

CSS-File

As mentioned above, are provided two CSS file for presentation.
For the first tests you should copy the file mod_visitors_fe.css from /system/modules/visitors to /tl_files . Then import them over the back end and activate it in the layout.


Technical Details

Technical details are inside of the category, in the counter denifinition and in the constructed front end module feasible / adjustable.


Technical Details inside of the category

Counting mode

From version 1.6.0, Counting mode is selectable, server side or browser side, by category:

  • Load counting, server side by Contao
  • Read counting, client side by browser
    • (only on Contao cacheMode: server and browser cache / only browser cache)

With "Read counting" can be counted when the page is in the browser cache and will be called from it. The system setting "Cache mode" will be respected.


Note.png Note: The display of current values will continue but only if the page is requested from the server.


Technical Details inside of the counter denifinition

Block time

The block time is in seconds. After interruption of the requests at this time, an access is counted as an additional visitor.
Pre-entered are 1800 seconds, so that is 30 minutes.


Technical Details in the front end module definition

Templates

Each module can be assigned its own Template. Four different templates are included.

  • mod_visitors_fe_all
    • All fields are included. (see example above)
  • mod_visitors_fe_hits
    • Here the visit rows were removed.
  • mod_visitors_fe_visits
    • Here the hit rows were removed.
  • mod_visitors_fe_invisible.tpl
    • Here, nothing is displayed. This template is used for a pure counting.

For own Templates, the template files must start with "mod_visitors_fe_" and end with ".tpl".

Show to guests only

Hide the module if a member (front end user) is logged in.

Protect module

Show the module to certain member groups only.

No counting for this HTTP_USER_AGENT partial identifier

You can set a custom UserAgent String in your browser and in the visitors module configuration.

  • Layout -> Themes -> Modules -> Module Name (Contao 2.9)
  • Layout -> Modules -> Module Name (TYPOlight 2.8.x)

In the field: "No counting for this HTTP_USER_AGENT partial identifier", you can enter a unique identifier.
Example: CTISOK
Save it.

Now, change the User Agent String of Mozilla Firefox:

  1. Type about:config in the Mozilla Firefox address bar and press ENTER,
  2. Type general.useragent.extra.firefox in the Filter bar,
  3. Double-click on the returned Firefox setting, where you can change a user agent string to overwrite the default.
  4. Add her "CTISOK" separated by space, e.g. "Firefox/3.5.2 CTISOK".


You can check your new User Agent String , type about: + ENTER in the Mozilla Firefox address bar and press ENTER, see last row.

For other browsers, see: walkernews.net - how to change user agent string


Insert-Tags

Show the values

From version 1.2.0 there is Insert-Tags to show the values.

 {{visitors::katid::name}}
 {{visitors::katid::online}}
 {{visitors::katid::start}}
 {{visitors::katid::totalvisit}}
 {{visitors::katid::totalhit}}
 {{visitors::katid::todayvisit}}
 {{visitors::katid::todayhit}}
 {{visitors::katid::averagevisits}}

From version 1.5.0 and from TYPOlight 2.8, Insert-Tags can be extended with prefix 'cache_'. Thus, these then cache resistant.

 {{cache_visitors::katid::name}}
 ...

The counting is continued through the module! Who wants to use to display the insert tags, the module continues to need, but only to count. With the templates mod_visitors_fe_invisible the module may be invisible, if desired.

To determine the category ID, go into the category overview of the module with your mouse over the "i".

Besucherzähler Kategorie ID
The tooltip displays the ID.
Or click on the "i", in the following site is in the first line the ID.
For category ID = 1 that would be like that:

 {{visitors::1::online}}


Count

An alternative to "counting only" would be to use an Insert-Tag. From version 1.5.0 there is another Insert-Tag. The module itself uses this as well:

 {{cache_visitors::katid::count}}

Example for installation in an article (for category ID = 1):

 <span style="width:0px;height:0px;">{{cache_visitors::1::count}}</span>
Caution.png Caution: It must be noticed, that the insert-tag for the count will be installed at first on the page so that the counting is carried out before the identification of the values.



More Insert-Tags

From version 2.1.0, there ist Insert-Tags for display the values of the day with the most visitors.

 {{visitors::katid::bestday::date}}   - Day (Date) with the most visitors
 {{visitors::katid::bestday::visits}} - Number of visitors of the day with most visitors
 {{visitors::katid::bestday::hits}}   - Number of hits of the day with most visitors
or
 {{cache_visitors::katid::bestday::date}}
 {{cache_visitors::katid::bestday::visits}}
 {{cache_visitors::katid::bestday::hits}}

The "date" insert-tag has an optional parameter to format the date output. (m.d.Y , Y-m-d, etc.)
The system setting is used as default. As a separator, a "::" are used.
A complete example (with category 1):

 Best Day: {{visitors::1::bestday::date::j. F Y}} with {{visitors::1::bestday::visits}} visitors 
(and {{visitors::1::bestday::hits}} hits)

results:

Best Day: 31. August 2010 with 25 visitors (and 123 hits)


Views
Personal tools

Contao Community Documentation

In other languages
Navigation
Discover
Understand
Enhance
Miscellaneous
Tools