Special scripts and coding


NOTE: The code in examples below sometimes includes an additional space for readability. Remove this space if you copy an example for your own use. If you put code on the website, make sure that the page is being displayed properly and features (such as buttons or forms) function properly. The addition of code elements such as mentioned here, can affect the features on the website.

 

Javascript links

 

Use these instructions, for example, if you want to analyze visits by visitors who:

  • open Javascript links or images
  • open webpages made with Ajax
  • go to an anchor (#) in an HTML page and you have not selected Anchors=On in the Snoobi basic tracking
  • need to add a variable such as a login name or product code to the tracking

 

These instructions assume that you have installed the Snoobi script.

 

An example of applying an onclick event

 

Use this feature to track clicks on a document download, if not already done by the standard Snoobi script:

 

snoobi.trackPageView (pathParam)

 

Add the function to the JavaScript event, for example to:

 

  • onClick
  • onmousedown

 

You can include a page name and section as parameters:

 

<a href="javascript:snoobi.trackPageView('/images/gallery/image1.jpg','pagename,'sectionname');">

 

Invalid characters

 

  • The characters & and = can not be used as a parameter value. Instead, use the URL encoded characters.
  • Spaces and special characters (such as accented letters, Chinese characters, etc.) cannot always be used in page and cluster names. If they are used,  the Snoobi script it is possible that it no longer functions.
    Snoobi uses UTF-8. Contact us if yiu have questions
  •  If you want to divide a single page in more than one cluster, add clusters manually, for example, by making use of the &addurl parameter. A single page in Snoobi can have only one cluster parameter.