Print

PHP script - visitor tracker code installation for [php] files

Installing a JavaScript visitor tracker code into php script files

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:

  1. 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.
  2. 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.
  3. Login to your TraceMyIP 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.
  4. 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.
  5. 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 TraceMyIP 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.
Once you have verified your tracker installation, your visitor tracker is ready to capture data.

For more information on how to check your tracker code installation, see this page.



Help

Help Desk

---> My Account
---> User Manuals
  ---> 1. Visitor Tracker
  ---> 2. Link & Page Trackers
  ---> 3. Campaign Tracker
  ---> 4. IP Address Book
© 2010 IP Web Tracker [IPWebTracker.com]. All Rights Reserved. All other trademarks are the property of their respective owners.