Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Google Analytics to track outbound links

  • 06-07-2010 12:42AM
    #1
    Registered Users, Registered Users 2 Posts: 391 ✭✭


    Hi,

    Just wondering if there's any Google experts out there can help with a serious problem I'm having. I've a price comparison site set up and working 100% where links to products are shown along with short descriptions - clicking on the links then opens external sites in a new window.

    None of which is showing up in Google Analytics. If I take out the bit that launches the new window
    <a href="http://www.externalsite.com/" target="_new"....
    

    then it works fine. I've tried various differing methods as detailed by Google in their ever changing documentation but am getting nowhere.

    Any suggestions appreciated - particularly from those who may have come across this before.

    Many thanks

    ZB


Comments

  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    Are you saying that if you take out target="_new" then the links show up in GA? Sometimes _new is confused with _blank (which has been deprecated IIRC).

    Either way, I think it is better practice to have neither and let the user decide where they want the content in a new window or in the existing window. Hopefully, this is sort out your problem too.


  • Registered Users, Registered Users 2 Posts: 391 ✭✭zaphodbeeb


    Evil Phil wrote: »
    Are you saying that if you take out target="_new" then the links show up in GA? Sometimes _new is confused with _blank (which has been deprecated IIRC).

    I've tried both _blank and _new.
    Either way, I think it is better practice to have neither and let the user decide where they want the content in a new window or in the existing window. Hopefully, this is sort out your problem too.

    You may be right - but that decision isn't up to me. The idea is that you can see a list of (say for example cars) then click on each one and view in another window [the referring site] - close that window and still see the list that sent you there in the first place ...


  • Registered Users, Registered Users 2 Posts: 4,775 ✭✭✭JohnK


    As far as I'm aware if you're tracking a click to a new window you need to track the click using javascript in the onclick event of the link, similar to this article http://www.google.com/support/googleanalytics/bin/answer.py?answer=55527


  • Registered Users, Registered Users 2 Posts: 391 ✭✭zaphodbeeb


    JohnK wrote: »
    As far as I'm aware if you're tracking a click to a new window you need to track the click using javascript in the onclick event of the link, similar to this article http://www.google.com/support/googleanalytics/bin/answer.py?answer=55527

    Thanks for that. As I said though, I've tried many methods including the above and they work SO LONG AS the link to the external site opens in the same window.

    This as I mentioned, is not what I need. I need the link to open in a new window.

    Does anyone know of a method by which you can actually *gasp* TALK to a Google person who can help? Do these people actually exist ahahaha :-)


  • Registered Users, Registered Users 2 Posts: 4,775 ✭✭✭JohnK


    Can you post the html of your page so? This is the code that I've just pulled off one of my sites and this tracks perfectly

    <a href="http://www.google.com&quot; onclick="pageTracker._trackPageview('/URL/YOU/WANT/TO/TRACK/');" target="_blank">blah</a>


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 391 ✭✭zaphodbeeb


    Many thanks. As regards posting the URL of the site, I'll check. :-) Not up to me.

    I notice that the URL you have as an example is on the same site - I presume it could be an external link....

    Thanks again - will try that and update this tomorrow.


  • Registered Users, Registered Users 2 Posts: 4,775 ✭✭✭JohnK


    So far as GA is concerned anything you're tracking will be a page of your site so in the above example GA would think the URL is http://www.mysite.com/URL/YOU/WANT/TO/TRACK/
    Might be easier to spot the outbound links by tracking them as something like /OUTBOUND/www.example.com and /OUTBOUND/www.google.com etc. so you can easily find them for reports


  • Registered Users, Registered Users 2 Posts: 391 ✭✭zaphodbeeb


    Something like...


    <a href="http://www.externalsite.com&quot; onclick="pageTracker._trackPageview('/OUTBOUND/External_Site/');" target="_blank">blah</a>


    Thanks for the help!


  • Registered Users, Registered Users 2 Posts: 4,775 ✭✭✭JohnK


    Yeah that should do it.


Advertisement