WordPress.org

Ready to get started?Download WordPress

Forums

Need help with outbound link tracking (3 posts)

  1. MarketingTechy
    Member
    Posted 1 year ago #

    I need some help with outbound link tracking. My first choice would be to track events through Google Analytics as I also use Analytics for page view tracking etc.

    I am having trouble deciding which plugin to use for tracking outbound links from my site: http://www.inflatablesuphq.com
    The current plugin I am using is WP Analytics Tracking. It works well for page tracking, but does not do outbound link tracking through events in Analytics.

    I am looking for a plugin that will do this and also work with WP 3.5 as i will upgrade soon. It seems like some of the plugins have not been updated for some time and I am worried about compatibility.

  2. Tony
    Member
    Posted 1 year ago #

    Hi.
    Let's see a couple of things.

    First of all, don't worry you will not have any trouble of compatibility issues with WP 3.5 and WP Analytics Tracking.
    The main purpose of this plugin is to let you easily add any HTML code you want on all your pages. So it's perfectly designed to add the Google Analytics Tracking code.

    I know a solution to track the click on a single link with Google Analytics. Basically, here is the idea :
    1- Create an event in your Google Analytics interface
    2- Get the ID of this event
    3- On your WordPress page (or post), use the editor in HTML mode (tab on the upper right hand corner).
    3- Add for example this following code for one link (adapt the URL with the URL of your choice) :
    <button onclick="window.open('http://www.google.com/');_gaq.push(['_trackEvent', 'nbr-clic', 'click-button1']);">link</button>
    This code is a button. When you click on it, it opens a new windows in javascript and you trigger the Google Analytics event.

    I haven't tried it, but you may also try this code :
    <a href="http://www.google.com/" onclick="_gaq.push(['_trackEvent', 'nbr-clic', 'click-button1']);">link</button>
    This code is a "normal" link. But I don't know if the Google Analytics event is properly triggered.

    I don't think it is possible to automatise this process for all your link.
    Hope this answer helped you.

  3. MarketingTechy
    Member
    Posted 1 year ago #

    Thanks Tony, that gives me a good start.

    I need it for links, so I will try the second version. Makes sense, just need to see if it triggers.

    PS: If anyone knows of a plugin that will help with triggering events in Analytics based on links clicked it will definitely help.

Topic Closed

This topic has been closed to new replies.

About this Topic