Commit 89e2cf94 authored by hass's avatar hass
Browse files

#1817562: Keep the internal URL for Google Analytics website overlay

intact.
parent 37e9ee4a
(function ($) {
$(document).ready(function() {
// Expression to check for absolute internal links.
var isInternal = new RegExp("^(https?):\/\/" + window.location.host, "i");
// Attach onclick event to document only and catch clicks on all elements.
$(document.body).click(function(event) {
// Catch the closest surrounding link of a clicked element.
$(event.target).closest("a,area").each(function() {
var ga = Drupal.settings.googleanalytics;
// Expression to check for absolute internal links.
var isInternal = new RegExp("^(https?):\/\/" + window.location.host, "i");
// Expression to check for special links like gotwo.module /go/* links.
var isInternalSpecial = new RegExp("(\/go\/.*)$", "i");
// Expression to check for download links.
......@@ -56,7 +58,7 @@ $(document).ready(function() {
$(document).bind("cbox_complete", function() {
var href = $.colorbox.element().attr("href");
if (href) {
_gaq.push(["_trackPageview", href]);
_gaq.push(["_trackPageview", href.replace(isInternal, '')]);
}
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment