If you have an unrestricted access to your site’s php files, you can install a PHP visitor tracker code directly into a header or a footer php file of your website. The best location for a tracker code is in the header of your website as it will guarantee that your website tracker will monitor all pages of your website, and the visitors will be detected as soon as they view your website pages. If the tracker is positioned at the bottom of the page, it may not be loaded properly after all the content of your website. If you are a premium subscriber, you can also enable a hidden tracker by following these steps.
To install the tracker code:
- Locate a .php file that is used throughout your entire website, meaning, it’s included in every page of your website. Commonly, the files that contain either “header” or “footer” words in their filenames, are used through an entire website.
- If you cannot find a file that would look like a header or a footer file, look at what the URL address bar of the browser that you’re using is showing when you navigate your website. If you see that an index.php file is used for all pages that you’re browsing and with page name variables simply appended to the index.php file, then you can edit and install your visitor tracker code directly into that index.php file.
- Login to your MobileTracker account and generate your tracker code by either adding a new project, or clicking on the “tracker code” link corresponding to your project. Select “PHP Code” from the [Code Type] drop down menu. If you need an SSL and/or XHTML compliant codes, enable the appropriate check boxes.
- Open a corresponding header, footer or an index [.php] file with your php script editor and place your php visitor tracker code at the top of the page right after the opening PHP script tag that would look like <?php or <? and save your php file. Note, that you must use exactly the same tracker code throughout the pages that belong to your website project. If you are editing in offline mode, upload your edited php file.
- Navigate to your website and check that the tracker image appears on all pages of your website. If you have generated a code from an existing MobileTracker project, ensure that the tracker mode is not set to hidden mode. If your tracker image appears only on your home page and not on other pages, then you have selected a wrong php file that is not being used on all pages of your website. You may also need to place your tracker code separately on the pages that you would like to track if you are unable to find a php file that's included in all of your pages.
For more information on how to check your tracker code installation, see this page.