Forum Moderators: DixonJones
<a id='link' href='http://www.example.com/'>example</a>
<script type="text/javascript">
function link_click()
{
alert('yo');
}
document.getElementById('link').onclick = link_click;
</script>
Replace the alert by something that works with your tracking software.
If you use Google Analytics, then replace the alert with something like this.
function link_click()
{
urchinTracker ('/LinkClick');
}
Hope this helps.
[edited by: jatar_k at 5:20 pm (utc) on Jan. 15, 2006]
[edit reason] examplified urls [/edit]
<a id='link' href='http://www.example.com/'>example</a><script type="text/javascript">
function link_click()
{
urchinTracker ('/LinkClick');
}
document.getElementById('link').onclick = link_click;
</script>
I'm just wondering what advantage you might of found assigning the onclick hander manually like you did in your example, as opposed to setting the onClick hander directly in the link tag:
<a id='link' href='http://www.example.com/' onClick="link_click(); return true;">example</a>
Or the even cleaner version were your link_click function would return true?
Thanks,
Larry
[edited by: jatar_k at 5:21 pm (utc) on Jan. 15, 2006]
[edit reason] examplified urls [/edit]
Help Center: Supporting Google Analytics.Help Center > Reporting Basics [google.com]
How do I create a custom filter?
Google Analytics provides a number of custom filter options that make it easy to manipulate your data to match your reporting needs. Each type of custom filter has its own settings and features. We've provided in-depth instructions for each type of filter in the articles listed below:
* Include and Exclude filters [google.com]
* Search & Replace filters
* Lookup table filters
* Advanced filters
<a href="http://www.example.com"
onClick="javascript:urchinTracker ('/outgoing/example_com');"
GA thinks /outgoing/example_com is a page/folder on your server.
Now simply goto:
Content Optimization > Content Performance > Top Content
Above the graph you see a green "+" and the words "Filter"
In the form enter: /outgoing/ and press enter, now it only shows top content within the /outgoing/ folder. (which we made with the link above)
Hope that helps.
so, presumably i can setup the click out of site link as a site goal (G1..G4). in the example the goal URL would would be /outgoing/example_com?
i want to track newsletter signups as as site goal and we use a third party for that. so, i think the code presented in this thread will cure the problem for me because i can't put any conversion code on the site where the signups actually occur.