: 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
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.
More posts by @Merenda212
1 Comments
Sorted by latest first Latest Oldest Best
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);
});
});
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.