Mobile app version of vmapp.org
Login or Join
Merenda212

: Land on marketing domain, proceed to members-only domain. How to filter these? We would like to filter out (from our monthly GA reporting stats) those site visits where a user lands on our

@Merenda212

Posted in: #Filtering #GoogleAnalytics #Reporting

We would like to filter out (from our monthly GA reporting stats) those site visits where a user lands on our marketing domain and then immediately clicks our "Member Login" hyperlink (simple anchor tag) to navigate to our members-only site.

Our members-only domain is a subdomain (i.e., members.example.com) of the primary marketing (www.example.com) domain.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Merenda212

1 Comments

Sorted by latest first Latest Oldest Best

 

@Merenda212

The solution:


Create a custom event, call it using the onclick attribute of the anchor tag (of the outbound link), as per this article, using the JavaScript code below
Create an exclusion for that event using advanced segments

var trackOutboundLink = function(url) {
if (typeof ga !== 'undefined') {
ga('send', 'event', 'outbound', 'click', url, {
'transport': 'beacon',
'hitCallback': function(){document.location = url;}
});
} else {
console.log("Google analytics object was not found!");
}
}

jQuery(function() {
var url = "https://members.example.com";

jQuery("a[href *= 'members.example.com']").on('click', function() {
trackOutboundLink(url);
});
});

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme