This can be added to existing JavaScript files or in a script block as long as it’s loaded somewhere within the HTML body (ideally, just before the closing tag). jQuery (or your alternative) must be loaded first although the Google Analytics tracking code can appear anywhere on the page. /* Track outbound links in Google Analytics */ (function($) { "use strict"; // current page host var baseURI = window.location.host; // click event on body $("body").on("click", function(e) { // abandon if link already aborted or analytics is not available if (e.isDefaultPrevented() || typeof ga !== "function") return; // abandon if no active link or link within domain var link = $(e.target).closest("a"); if (link.length != 1 || baseURI == link[0].host) return; // cancel event and record outbound link e.preventDefault(); var href = link[0].href; ga('send', { 'hitType': 'event', 'eventCategory': 'outbound', 'eventAction': 'link', 'eventLabel': href, 'hitCallback': loadPage }); // redirect after one second if recording takes too long setTimeout(loadPage, 1000); // redirect to outbound page function loadPage() { document.location = href; } }); })(jQuery); // pass another library here if required The event is recorded with the category name ‘outbound’, action name ‘link’ and the value set to the URL of the outbound page. For example, incoming clicks from PCs can be redirected to your website instead of an app store. Determines unique and non-unique click distribution.
They keep URLs that are loaded with UTM tracking tags from looking ugly by hiding the length and characters in the UTM tracking system. Their story had a happy ending in that someone came in and saved them, but it was hard not to think of what would have happened if all their links stopped redirecting one day: part of the web would go dark. Complete control over which campaigns our clients can see in their accounts.
Low cost way to start a personal brand and make vanity URLs. Another operational limitation of URL shortening services is that browsers do not resend POST bodies when a redirect is encountered. To enable outbound link tracking, you need to add a little javascript to your website, and add a little code with each outgoing link that you want to track.
Linkrot[edit] The convenience offered by URL shortening also introduces potential problems, which have led to criticism of the use of these services. This can be added to existing JavaScript files or in a script block as long as it’s loaded somewhere within the HTML body (ideally, just before the closing tag). jQuery (or your alternative) must be loaded first although the Google Analytics tracking code can appear anywhere on the page. /* Track outbound links in Google Analytics */ (function($) { "use strict"; // current page host var baseURI = window.location.host; // click event on body $("body").on("click", function(e) { // abandon if link already aborted or analytics is not available if (e.isDefaultPrevented() || typeof ga !== "function") return; // abandon if no active link or link within domain var link = $(e.target).closest("a"); if (link.length != 1 || baseURI == link[0].host) return; // cancel event and record outbound link e.preventDefault(); var href = link[0].href; ga('send', { 'hitType': 'event', 'eventCategory': 'outbound', 'eventAction': 'link', 'eventLabel': href, 'hitCallback': loadPage }); // redirect after one second if recording takes too long setTimeout(loadPage, 1000); // redirect to outbound page function loadPage() { document.location = href; } }); })(jQuery); // pass another library here if required The event is recorded with the category name ‘outbound’, action name ‘link’ and the value set to the URL of the outbound page.
This UA code can be found next to your website’s profile in Google Analytics Dashboard. Free users can choose between “go.clickmeter.com“ or “9nl.com“ as a domain name for their tracking link, while pro users can choose their own domain name. We will show you how you can enable automatic tracking of all outbound links in Google Analytics with WordPress. Twitter is one social media platform that can make you learn how to be patient and humble. Not only is this good for link shortening, but it is also good for SEO. This count includes multiple clicks from individual recipients. Keep your website safe Running a periodic check on your website's links will ensure that your website remains protected against spam and hackers. The .ly namespace is controlled by Libya, you see, and the use of it is governed by strict rules.