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 lets you create short, branded URLs to share on social media. Use this example as a model for your own links: Check out example.com Analytics Events Was this article helpful?
Tracking Link Clicks with Event Tracking vs Virtual Pageviews You are also able to use virtual pageviews to track link clicks however, this technique may cause problems elsewhere. Only bitly provides the feature to generate custom URLs. A real-time dashboard with traffic analytics and referrer data shows how many people shared and clicked your links. bit.ly is a free service. If you click the shortened link on bit.ly, you get access to detailed traffic information related to number of clicks, referring Web sites, and geographic locations of the users who clicked.
STEP 1: Create a Link Click Listener Tag Note: This step is not required any more with newer versions of Tag Manager. This automatic behavior provides the best possible experience to your app users who open goo.gl links, no matter what platform or device they are on. Still, you can create shorter links for other uses that don’t rely on link shortening services. Plus+ Tracking If you have a Professional account, you can use our exclusive Plus+ Tracking feature to create special use tracking campaigns and sub-campaigns within your accout.
Undo Undo URL Shortener @URL_Shorteners_ 5 Dec 2012 More When to sell a name you make actually use.
Sitecatalyst.customTrack(this)"/>
Further data will appear in the Behavior > Events pane after a few hours.Please visit Eventbrite's pricing page or contact Eventbrite for their complete pricing information. Such scripts avoid many issues with shortening services, keep the domain name as part of the shortened link, and can be made private. And as with YouTube, if that limit was hit, they just have to add another number, which raises the limit to 1,152,921,504,606,846,976. If you can't find a link here, try the Wikipedia list of TLDs. It doesn’t work for any URL in the world, just WP.com-hosted ones. For PCs or other kinds of devices, these would be redirected to the iOS tracker, as it is the first. There are a lot of other link shorteners, many being novelty systems (like a link shortener that doesn’t really shorten but turns your URL into a Dickens quote, or one that makes your link look shady and nefarious, or one that churns out a hipster-phrased link) or ways to earn money for yourself or for charities through ads that appear before the user gets to the destination URL. In order to address the fear of linkrot happening when a link shortening service shuts down, the Internet Archive started the 301 Works project in an attempt to preserve the link shortening databases should participating services shut down. The general idea people have about Google Analytics is that it tells you how many vistors and pageviews you are getting, where the traffic is coming from, and what content is popular on your website. Once you click the share link, in addition to the social networking services you should see the URL of the video that can be copied and pasted anywhere. This is a string of encrypted numbers and alphabets.