homepage Welcome to WebmasterWorld Guest from 54.242.126.126
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / WebmasterWorld / Website Analytics - Tracking and Logging
Forum Library, Charter, Moderators: Receptional & mademetop

Website Analytics - Tracking and Logging Forum

    
Google Analytics - How do you track clickthroughs on links?
gfidan

5+ Year Member



 
Msg#: 3914 posted 6:25 pm on Jan 13, 2006 (gmt 0)

I have several advertisers who have purchased text links on my homepage. I'm wanting to know how many visitors click on these links. Is there any way to track this with Google Analytics?

thank you

 

randymorin

5+ Year Member



 
Msg#: 3914 posted 5:55 am on Jan 15, 2006 (gmt 0)

This is what I do (I use Google Analytics)

<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]

larryn

10+ Year Member



 
Msg#: 3914 posted 3:21 pm on Jan 15, 2006 (gmt 0)

Randy,


<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]

niels

5+ Year Member



 
Msg#: 3914 posted 3:33 pm on Jan 15, 2006 (gmt 0)

From Google Analytics help:

"How do I track clicks on outbound links?"

<a href="http://www.example.com"
onClick="javascript:urchinTracker ('/outgoing/example_com');"

Later in GA just use /outgoing/ as your filter.

gfidan

5+ Year Member



 
Msg#: 3914 posted 7:39 pm on Jan 15, 2006 (gmt 0)

Niels,

thanks for the answer, but I don't know how to go about adding a filter.

"Later in GA just use /outgoing/ as your filter."

I looked into it and I can't figure out how to do a filter for this particular situation. Do you mind giving me a little insight on that?

teylyn

5+ Year Member



 
Msg#: 3914 posted 8:36 pm on Jan 15, 2006 (gmt 0)

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


gfidan

5+ Year Member



 
Msg#: 3914 posted 6:45 am on Jan 16, 2006 (gmt 0)

I'm still totally confused here

niels

5+ Year Member



 
Msg#: 3914 posted 3:16 pm on Jan 16, 2006 (gmt 0)

When you use this:

<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.

Jack_Hughes

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3914 posted 5:00 pm on Jan 16, 2006 (gmt 0)

excellent thread. i've wanted to do something similar for ages.

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.

gfidan

5+ Year Member



 
Msg#: 3914 posted 8:17 pm on Jan 16, 2006 (gmt 0)

Niels,

You are my new hero! I didn't even realize there was a filter option up there.

Thanks, this will save me lots of time.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Website Analytics - Tracking and Logging
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved