How to Track Before a 301 Redirect

A 301 redirect is an extremely efficient way to redirect a user from one resource on your website to another. Unlike slower redirects, such as meta refreshes, a 301 redirect sends an HTTP 301 header that immediately tells a browser to redirect. This immediacy makes it difficult to load a traditional tracking script, which normally exists within the body of the document. You can edit your PHP file to perform tracking events before this 301 redirection occurs, making it possible to check errors and debugging problems in your code.

Instructions

    • 1

      Open the Start Menu and type "notepad.exe" without quotation marks into the search field.

    • 2

      Click "Notepad.exe" from the search result listing.

    • 3

      Open your PHP file that contains the 301 redirect.

    • 4

      Type "error_log("text");" without quotation marks on the line immediately above the 301 redirection. Replace "text" with the text that you'd like to write to your Web browser's error log file. This will track your presence on the site, assisting you with program debugging.

    • 5

      Click "File," then "Save" to save your changes.

Related Searches:

References

Comments

Related Ads

Featured