Manually Logging (click) Events With Javascript

To manually log click events with the Logaholic Javascript Tracker, you will need to add the following code snippet to your selected onclick event-handler (Replace “insertpage” with the URL of the page that needs to be logged when the click event is triggered.)

lwaLogPage(<"insertpage")
&#91;/html&#93;
<br>

<p>If your pages don't include click events, create them for each clickable element you'd like to track. If you need to do this, you can add the following code snippet to your HTML element. (Again, replace ''insertpage'' with the URL that needs to be logged.)</p>
<br>

[html]
onclick="lwaLogPage(\"insertpage\")"


Example 1: Tracking download files

If you have implemented tracking on a page that contains a link to a PDF document, your Logaholic reports will not include statistics showing when visitors click on the link that downloads the PDF file. To include these clicks in your statistics, you will need to add the following tag to your web page:

Below are two code snippets: The first shows a link without the tag. The second shows a link that contains the tag.

Without tag:

<a href="somedocument.pdf">A link to a PDF document.</a>

Contains tag:

<a href="somedocument.pdf" onclick="lwaLogPage(\"somedocument.pdf\")">A link to a PDF document.</a>

Example 2: Tracking ‘Exit Clicks’ from your site to another

If you have implemented tracking on a page that contains a link to an external website, your Logaholic reports will not include statistics showing when visitors click on the link to the external site. To include these clicks in your statistics, you will need to add the following tag to your web page:

Without tag:

<a href="http://www.somewebsite.com/somepage.html">A link to an external webpage.</a>

Contains tag:

<a href="http://www.somewebsite.com/somepage.html onclick="lwaLogPage(\"http://www.somewebsite.com/somepage.html\")">A link to an external webpage.</a>