Welcome to WebmasterWorld Guest from 54.159.214.250

Forum Moderators: DixonJones & mademetop

Google Analytics - How do you track clickthroughs on links?

   
6:25 pm on Jan 13, 2006 (gmt 0)

10+ Year Member



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

5:55 am on Jan 15, 2006 (gmt 0)

5+ Year Member



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]

3:21 pm on Jan 15, 2006 (gmt 0)

10+ Year Member



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]

3:33 pm on Jan 15, 2006 (gmt 0)

10+ Year Member



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.

7:39 pm on Jan 15, 2006 (gmt 0)

10+ Year Member



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?

8:36 pm on Jan 15, 2006 (gmt 0)

10+ Year Member



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

6:45 am on Jan 16, 2006 (gmt 0)

10+ Year Member



I'm still totally confused here
3:16 pm on Jan 16, 2006 (gmt 0)

10+ Year Member



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.

5:00 pm on Jan 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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.

8:17 pm on Jan 16, 2006 (gmt 0)

10+ Year Member



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.

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month