Event Tracking Analytics

This topic contains 3 replies, has 2 voices, and was last updated by  gaynorh 9 years, 6 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #19682

    gaynorh
    Expired Member
    Post count: 29

    Hi

    Is there anyway to add event tracking on the directory outbound contact links please so that clicks can be tracked via analytics?

    Here is how Google guide how to do this https://support.google.com/analytics/answer/1136920?hl=en – however this is for an href link not dropping a url into a field as the directory is set up.

    Thanks
    Gaynor

    #19743

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    it is possible, however you have to modify the code of the Send Enquiry URL.

    from :

    
    
    
    <a class="b_send_inquiry" href="javascript:void(0);">Send Enquiry</a>

    to

    <a class="b_send_inquiry" onclick="_gaq.push(['_trackEvent', 'Send Enquiry']);" href="javascript:void(0);">Send Enquiry</a>

    Given that for a small addition, you would have to modify far too much code, I’d add it with javascript.
    This:

    
    
    jQuery(document).ready(function() {
     jQuery('a.b_send_inquiry').click(function(e) {
      _gaq.push(['_trackEvent', 'Send Enquiry']);
     });
    });

    in GD >> Design >> Scripts >> Footer script code

    We haven’t tested it, but I don’t see why it shouldn’t work.

    Thx

    #19770

    gaynorh
    Expired Member
    Post count: 29

    Thanks for the reply – I will give it a test and post back if it all works

    thanks

    #21244

    gaynorh
    Expired Member
    Post count: 29

    Hi

    Just a quick update and part solution

    The plugin “Google Analytics by Yoast” has a setting of “Track outbound click & downloads” once selected this records all outbound clicks in analytics showing:

    Event action with the page url and Event label with the page name.

    It doesn’t however break down any links into type eg Facebook link or contact link – maybe this could be added to your developments?

    thanks
    Gaynor

Viewing 4 posts - 1 through 4 (of 4 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket