Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Improve Outbound link #23

Closed
HonzaMikula opened this Issue · 6 comments

2 participants

@HonzaMikula

Many pages dynamically load some of content using Java Script (AJAX). If in dynamically loading content is some outbound links, GAS won't track them. In jQuery is something like .live() to solve this problem. It is possible to improve Outbound link tracker this way?

Thanks.

@eduardocereto

Closing as invalid.

GAS already uses Event delegation that mimics jQuery live.

Its applied to:

  • Download
  • Media (HTML5 video/audio)
  • Outbound
  • MailTo

The only places that don't use event delegation are Form Tracking and Youtube/Vimeo video tracking.

Form tracking doesn't use it because change events don't bubble on ie8-

Youtube and Vimeo don't use because they are not DOM events, we use an API to track those.

@HonzaMikula

Then I don't know it's my fault or bug in GAS, but on site http://crazycafe.centrum.cz it doesn't work. In very top of the page is black navigation to other services. This navigation is loading dynamically using Java Script and if I click on some services, GAS doesn't make event. I don't have idea why.

@HonzaMikula

Ok i know what is the problem. We use current domain as utm_source parametr, so GAS thinks that it's internal link even it's not. For example http://www.cars.cz/?utm_source=crazycafe.centrum.cz&utm_medium=header. I don't know if it's bug or not.

@HonzaMikula

What about change line 1104 in gas.js to:

if (
(l.protocol == 'http:' || l.protocol == 'https:') &&
sindexOf.call(l.hostname, document.location.hostname) === -1)

? I think it would fix the problem.

@eduardocereto eduardocereto reopened this
@eduardocereto

Good catch. I'll try to fix that.

@eduardocereto eduardocereto closed this issue from a commit
@eduardocereto eduardocereto Fixes #23 - Fail to fire outbound links if original domain is found i…
…n the url, even if outside the hostname part.
bc23a7f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.