Most Popular
Recently Added
Recently Updated

custom url/ ot_url

Problem:

These problems have similar solutions:

1. How do I tell opentracker to measure a custom url.

2. Opentracker see pages as different, but I want opentracker to count them in the same tally.

3. How do I tell opentracker to count two or more pages as the same page (i.e. the same url).

4. How do I tell opentracker to limit the number of unique pages or force the url to be [fill in your url].

5. How do I tell opentracker to group the pages in the most popular pages report (or top files and directories) in a different way.

Summary

Opentracker automatically detects the url of a page viewed, and with a customized version of our script you can overwrite that detection and 'send' the altered url you want opentracker to have.


Solution:

Use the parameter ot_url, to "set" the URL of the page tracked (without opentracker picking it up automatically), to reduce the number of page/ url variations.

The syntax for custom urls:

The parameter ot_url should be appended to the script. The value should be a valid url e.g. http://domain/path/file.html

Please take a look below. This example script should be duplicated by replacing the original opentracker.net script on the problem page:

<script defer src="http://server1.opentracker.net/?site=www.opentracker.net&ot_url=http://www.domain.com/path/filename.html" mce_src="http://server1.opentracker.net/?site=www.opentracker.net&ot_url=http://www.domain.com/path/filename.html"></script>

The above script will record the page url as http://www.domain.com/path/file.html overriding the "real" page url.


Another example:

Using a sample url to explain the steps you need to take:

http://www.domain.com/page.asp?ID=96

At the moment your script on this page looks like this:

<script defer src="http://server1.opentracker.net/?site=www.domain.com" mce_src="http://server1.opentracker.net/?site=www.domain.com"></script>

To override our detection you need to change the script:

The parameter ot_url should be appended to the script. The value should be a valid url http://domain/path/file.html

Example of an implemented solution:

<script defer src="http://server1.opentracker.net/?site=www.domain.com&ot_url=http://www.domain.com/page.asp?ID=96" mce_src="http://server1.opentracker.net/?site=www.domain.com&ot_url=http://www.domain.com/page.asp?ID=96"></script>

This will register every visit to that page with the same url.

Of course you do not want to manually change every page on your site, and therefor we suggest that you dynamicly generate the ID nr in the script.

Example of an implemented dynamic solution:

<script defer src="http://server1.opentracker.net/?site=www.domain.com&ot_url=http://www.domain.com/page.asp?ID=<%= id %>"></script>

As a last point we also suggest that you dynamically generate a page title for every page. This makes reading the reports and clickstreams much easier. It also good for search engines.


Properties ID: 000014   Views: 8605   Updated: 2 mins ago
Filed under: