Results 1 to 4 of 4

Thread: GA Tracking Outbound Links
      
   

  1. #1
    Join Date
    Aug 2009
    Location
    Germany
    Posts
    38

    Default GA Tracking Outbound Links

    I want to track the outgoing links with Goggle Analytics. To do that have to put the script


    <a href="http://www.example.com" onClick="trackOutboundLink(this, 'Outbound Links', 'example.com'); return false;">


    as trackEvent() into the <a>-Tag of the links.


    As I have the links in the menu I canīt find any place were to past it into. Where do I find the <a>-Tag of the links when in the menu ?


    Best regards


    Thomas

  2. #2
    Join Date
    Mar 2006
    Posts
    14,683

    Cool Re: Tracking out going links

    You need to understand a bit more about Google, Google Analytics, and SEO to understand why Analytics and "Event Tracking" is even possible, and when and where it is specifically to be used.

    It all goes back to April 2010 when Google was facing a crisis in being able to cogently value websites (with regard to assigning Page Rank) by using an algorithm that would prove more fair and functional with the explosion of websites coming onto the Net. The method of SEO parameters proved too many and too often exploited by Websters across the board, and the long-time avoidance of resolving how to optimize Flash sites (which represented about 35% of all sites at the time) forced a re-think overall on SEO standards. Google used the predicament of how CNN was going to expand their platform to include optimal SEO when there was such a dependence on advertising revenue being based on actual Metrics that did not include more than 40% of the Content on the CNN site (video, stream, RSS, etc.), so it was the perfect time to hammer out the new Rules for Google Search and SEO. Using the construction of "AC360" (CNN's Blog for Anderson Cooper) in a customized blend of Wordpress and Mambo (both Open Source) as their "new" proprietary CMS, Google sat down with us to figure out how to optimize Flash, Video, and other common elements that heretofore went ignored. Now, mind you, this project was relevant for those who coded their sites (hand-coded, or Dreamweaver, Adobe Flash, etc.), and not for those who relied on HTML generators such as BlueVoda, so the methods we came up with were specifically intended to be "coded-in" and thus offered more "elements" within the Page Code to actually become valid "attachments" upon which to affix variable constructs that could be "read" and counted toward an Ideal for value. You could not, for instance, "add code" or "construct" to an actual Video but upon the video element (i.e. the player); you could not modify Flash-created elements, but you could "attach" more coded import to the Meta of a Flash object, and so on.

    So ... by "adding" small "descriptors" to elements and objects (not "Navigation"), we were able to increase the number of attributes to things like Flash Players, Video Files and Players, and a whole host of other commonly used "elements" on websites that the heavier, more burdensome algorithm was previously ignored entirely. This new expanded "attribute" List provided the reasonable expectation that SEO would then be more fairly attentive to valuing common objects on pages, but this new List also required a cost of time to read in order to be effective, and as the Net was exploding with millions of sites that needed to be Ranked, the compromise of reducing the weight of Google's Algorithm was required. THIS is why the algorithm was "reduced" from so many variables that were being mass-exploited and the return to the Core aspects of Build (that the pages were constructed within ideal manner -- precisely, with all the layout details attended) META (all Meta entries present and demonstrating actual Relevance -- which now included the new attributes on Flash Players and Videos), and overall Relevance (the concise meshing of Content, META, Navigation, and Page Elements -- picture file Names, Alt Text, Navigation construct, Keywords, etc.).

    This re-focus on fewer individual "categories" with a stricter compliance required was the only way Google could reduce the algorithm while increasing accuracy, fairness of ranking, and the volume of sites required to be indexed.

    Still, the premise for Google Analytics "incorporating" the new method of valuing these new attributes meant new instances for accomplishing this methodology, and thus, Event Tracking ....

    Google Analytics Tracking Code was developed especially to track events in websites (especially Flash-based sites, etc.) or website objects (Flash Players, Video Players and their controls, slideshows, etc.) that otherwise were not "Search Engine-Friendly" and are not meant to specifically track standard "outbound links" per se, as this is already a part of the Google Analytics Page Metrics Report. You just have to know how to read the PageView and Reports to see this is true.

    This is clearly explained in the preamble on the Google Analytics Support Page:
    Event Tracking is a method available in the ga.js tracking code that you can use to record user interaction with website elements, such as a Flash-driven menu system. This is accomplished by attaching the method call to the particular UI element you want to track. When used this way, all user activity on such elements is calculated and displayed as Events in the Analytics reporting interface. Additionally, pageview calculations are unaffected by user activity tracked using the Event Tracking method. Finally, Event Tracking employs an object-oriented model that you can use to collect and classify different types of interaction with your web page objects.
    - With ga.js, you would commonly apply Event Tracking to:
    - Any Flash-driven element, like a Flash website, or a Flash Movie player
    - Embedded AJAX page elements
    - Page gadgets
    - File downloads
    - Load times for data

    This manner and method understood as described, there are two parts to properly using the coding provided in the examples:

    A. You need to "create the event" which is to be tracked, and this definition is configured by installing the Event Code in the HEAD of your Page, which is done in BlueVoda via PAGE HTML > HEAD Tab > Paste in Code:
    <script type="text/javascript">
    function trackOutboundLink(link, category, action) {

    try {
    _gaq.push(['_trackEvent', category , action]);
    } catch(err){}

    setTimeout(function() {
    document.location.href = link.href;
    }, 100);
    }
    </script>

    B. The next step is to paste the actual Link Event script as part of the Link itself in order to "delay" the Link Action so the tracking script can run and function. This Code (as you offered above) is added to the Page HTML by editing the page directly (which can be done in cPanel >FILE MANAGER > EDIT HTML) pasting the Code within the BlueVoda-created HTML for that specific Link:
    <a href="http://www.LinkHere.com" onClick="trackOutboundLink(this, 'Outbound Links', 'LinkHere.com'); return false;">



    If you are trying to install the Tracking Code to a "simple" Outbound Link you have in a BlueVoda MenuBar or Sliding Menu for instance, you will need to modify slightly the Code so you can "insert' it into the Hyperlink Dialog to have it included when BlueVoda generates HTML when publishing. I am not sure this method will actually work on a "simple Link," or in using this method within BlueVoda (as I have not ever encountered anyone who has misunderstood GA'S Event Tracking before, or tried to use it to track Link activity in addition to General GA Pageview Metrics), but as far as I can tell, this is the only way to do it.
    You will paste this part of the Code in the URL field of the BlueVoda Hyperlink Dialog:
    http://www.LinkHere.com" onClick="trackOutboundLink(this, 'Outbound Links', 'LinkHere.com'); return false;"

    You must include the Code (Part A above) via Page Html whenever using this method, otherwise it will not work!
    . VodaWebs....Luxury Group
    * Success Is Potential Realized *

  3. #3
    Join Date
    Aug 2009
    Location
    Germany
    Posts
    38

    Default Re: Tracking out going links

    Thanks Vasili for your extensive explaination.

    I have the menu as html box on each page.

    Do I have to copy the script:

    <script type="text/javascript">
    function trackOutboundLink(link, category, action) {

    try {
    _gaq.push(['_trackEvent', category , action]);
    } catch(err){}

    setTimeout(function() {
    document.location.href = link.href;
    }, 100);
    }
    </script>


    into the head of each page where the menu html box is in ?


    Do you mean that this code

    http://www.LinkHere.com" onClick="trackOutboundLink(this, 'Outbound Links', 'LinkHere.com'); return false;"

    has to be copied into the menu, property - edit and there URL ?

    Regards

    Thomas

  4. #4
    Join Date
    Mar 2006
    Posts
    14,683

    Arrow Re: GA Tracking Outbound Links

    1. Part A goes into the Page HEAD as mentioned above ... PAGE HTML > HEAD Tab > PASTE CODE

    2. Part B is added to the Menu script in your BlueVoda HTML Box (use the full version, not the last). You add/edit/replace elements of Part B Code into existing Link Code. IF it is possible at all, as I mused in my comment above ...

    Again, this is a useless application of Event tracking, as your Menu is not an "object" and Navigation is not a metric valued (unless presenting a broken link, as in missing page) even as part of the GA PageView. You can figure it out.
    . VodaWebs....Luxury Group
    * Success Is Potential Realized *

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •