- TraceWatch Websites
- Normal Website
- Sub Website
- Defining a Website
- Redirecting Requests to a Certain TraceWatch Website
- Getting Stats for a Remote Website
TraceWatch can track visitors to multiple websites with only one installation. When you install TraceWatch, one default website is defined for you but you can define additional websites later.
There are two types of websites you can define: a Normal Website and a Sub Website.
You get completely separate and independent stats for each normal website.
This type of website is usefull when your websites are very much independent and doesn't make sense to mix their stats.
A sub-website only prefixes page names with the sub-website's name to distinguish them from the parent website and other sub-websites pages, other than that everything else is shared.
Supose you have two domains example.com and support.example.com and trace them under a single TraceWatch website, requests to http://example.com/ and http://support.example.com/ will both count as request to page / which is most probably not what you want. but if you define a sub-website support.example.com for the website example.com and name it "Support" and redirect traffic from support.example.com to that sub-website (which you will learn how shortly) request to support.example.com/ will count as page Support: /
This type of website is useful when your sub-website is actually an integrated part of your parent website just using a different sub-domain.
Defining a Website
To define a website go to Administrate > Websites and fill the information inside the "New Website" box and then click "Add Website". The information you enter for a website are as follows:
- This will show up in the websites drop-down list on top of report pages for normal websites. For sub-website page names will be prefixed with this name.
- This is a unique id that you will reference this website with when needed. (can be anything but it's recommended that you use all lowercase letters and don't start with a number).
- Domains of a website and all it's sub-websites will be excluded from referrers. Also the first domain in any website's list of domains will be used to link page names to actual pages when the page name is clicked.
Redirecting Requests to a Certain TraceWatch Website
The default codes you put on pages to trace them send requests to the default website. To send requests to an alternate website you should specify the website ID in the code. To do this use the code generator and enter your website ID to get special code for that website.
Getting Stats for a Remote Website
First we need to define what a remote website is.
- Local Website
- A website that resides on the same physical server as TraceWatch and has local access to twatch files. In PHP terms a website that PHP pages on it can locally include any file within twatch folder.
- Remote Website
- Any website that is not a local website.
For local websites you can use the normal php code with the proper website ID to trace requests.
The second and the better way is to use the remote code.
To use the remote code on the remote website first you need to copy one file from the twatch folder to the remote website.
- Copy /twatch/api/RemoteLogRequest.php file to anywhere you like on the remote server. This is the only twatch file you need on the remote server.
- Use the code generator and choose "Remote PHP" to get code to put on your remote website's pages. Make sure you enter values for "domain name of the website where TraceWatch is installed" and "RemoteLogRequest.php file is in" fields.