Closed (fixed)
Project:
Google Analytics
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Aug 2010 at 13:47 UTC
Updated:
3 Oct 2010 at 11:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
retrodans commentedIt appears there is a problem with:
$(document.body).click(function(event) {
I put an alert in, and when an outgoing link is clicked, the function above isn't run, it does work alright with:
$('a').click(function(event) {
Comment #2
retrodans commentedFurther testing appears to show that it's to do with javascript on our end controlling whether a new tab is opened or not using a class. This is done so that users can disable the new tab system, giving them control back over their browser. Is there a way around this, or is it something we will have to consider in our development?
Note: Have changed category to 'support request' as have found what is causing the issue
Comment #3
hass commentedCan you provide an live url and detailed step by step instruction how to repro, please?
I remember someone else had the same type of problem, but was unable to repro nor had an idea what the real source of this clicks was. Would be great to understand and solve it.
Comment #4
retrodans commentedI'm afraid the site we are experiencing these issues with is currently in development, so the url is locked down. But as for a step by step guide:
1. Install newest dev version of GA module (uses asynchronous browsing)
2. Setup listener to handle click events for external links
3. Setup jquery.tools scrollable effect
It's the line 'return false;' which is causing the outgoing link. I will just remove this line, and it would then work and start tracking the outgoing links.
BUT this isn't going to solve the random 'click' events appearing without any href data. The href data does seem to get sent across, so will see how it all changes with the 'return false' removed, and will update on whether this alone solves the issue.
Comment #5
hass commentedDo you know that the ga module already have an external links click event listener or is this only an example?
Comment #6
retrodans commentedThe example was to purely open a new tab in the browser, not to handle GA. I could use the function in the module and amend it, but would rather not modify the modules code if possible.
Comment #7
hass commentedI need an example code snippet for a repro case - not any unrelated code. I have no idea what I should do with above code example, as it does not represent a link example that coud theoretically be broken nor any special case.
Comment #8
retrodans commentedSorry for the late response to your message, I am not getting notifications when people post responses. I went into the module and did some alerts within the modules js
This showed me that when an attribute similar to below is clicked, the alert gets called:
So what I think would fix the issue is to amend the if statement to the below, this will make sure the click event is actually going to go somewhere before tracking it.
What are your thoughts on this? I may need to use this on our site, so I could setup a patch if you think it is of use.
Thankyou,
Dan
Comment #9
retrodans commentedI created a patch (my first so far). Hope this helps someone, if there are issues with what I have done, please do let me know, I will try to check back here when I can.
Comment #10
hass commentedComment #11
hass commentedCommitted your fix to all branches.