Setting the transport method to 'beacon' lets the hit be sent * using 'navigator.sendBeacon' in browser that support it. */ var trackOutboundLink = function(url) { ga('send', 'event', 'outbound', 'click', url, { 'transport': 'beacon', 'hitCallback': function(){document.location = url;} }); } You'll also need to add (or modify) the onclick attribute to your links. Especially with Twitter which allows 144 characters only, it becomes immensely important not to exceed the its limit and see that our information is succinct. This should be for the link domain only; no wildcards. The website is just as basic it was when it launched, but it does the deed. If you need to change your URL on your social network page, it's easy to do.) Bitly Bitly is at the top of the URL shortening game. 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.
A shorthand link is associated with the registered URL. We can also store your Google Analytics ID to track visits to your campaign pages and hosted campaign archive, so you can see traffic to these pages in your Google Analytics account. Publish one custom branded short link on my business card, then keep the destination URL updated so that people are always taken to my latest blog post when they visit. Additionally, if a link source is moved between the NTFS 3.
Additionally, pageview calculations are unaffected by user activity tracked using the Event Tracking method. Most Twitter clients like YoruFukurou will shorten long URLs for you, but for other occasions when you need to shorten URLs, there’s Bitly.com. Scott Hanselman wrote a short but interesting post tracing the amount of redirection that happened on a single shortened link.
If you need quick and dirty link shortening, maybe Bitly is then the best for you. Add the target URL in the Link To box, then expand the Link Tracking area. However, if the ad_id parameter is omitted entirely from the tracking link, then HasOffers generates a typical transaction ID for the click session. If you create a tracker in the dashboard - let’s say we call it “AdNetwork” - you’ll receive a URL like: Onto this URL, you are able to add the “campaign” parameter to segment users into different campaigns: Any user clicking on a URL with the “campaign=CAMPAIGN_1” parameter would be assigned to the “CAMPAIGN_1” sublevel within your top network tracker “AdNetwork”. One of the most commonly asked question was how to track links in WordPress using Google Analytics? Affiliate sub ID parameters are often used to store non-unique values from the publisher's tracking system, in some cases to forward to an advertiser.
STEP 3: Simple Tag Testing After you’ve saved your new tag, go ahead and select Preview, and then Debug: Then, open up your website to a page you’d like to test. Custom Variables If using the affiliate sub IDs and source values are insufficient for passing through values on click to the landing page, you can set up custom variables to use in the offer URL and tracking link. Tag Type: Select either “Universal Analytics” or “Classic Analytics”, depending on whichever you are using. Top-level domains of countries such as Libya (.ly), Samoa (.ws), Mongolia (.mn), Malaysia (.my) and Liechtenstein (.li) have been used as well as many others. There are a few ways though: Hard code event tracking script Google Tag Manager Plugins (Gravitate Event Tracking Plugin) Event tracking simply applies a hot element on the page and whenever a user clicks on that element, it sends a singal to Google Analytics. Having a link shortener protects users from malicious sites that engage in spreading malware, phishing attacks, and other harmful activity. Bit.ly, which is what we integrate with in CoSchedule, uses a 301 redirect. Some websites allow other websites to create links. Add TinyURL to your browser's toolbar Click and drag the following link to your links toolbar. There are two techniques that we are going to discover today in this video: Outbound Link Tracking with UTM Parameters Inbound LInk Tracking with Google Analytics Event Tracking Depending on what kind of Link you want to track theses are the methods that will let you accomplish Link Tracking. 🔗 Links mentioned in the video: UTM Tool: Manual Event Tracking: ... 🎓 More from Measureschool 🆓 Correct Google Analytics Setup Course: ... 🆓 GTM Resource Guide: 🆓 GTM Beginner course: Courses: 📚 Recommended Measure Books: ... 📷 Gear we used to produce this video: ...Autotrack Autotrack is a JavaScript library built on top of analytics.js that makes it easier for web developers to track the user interactions that are common to most websites. In the example above we have created a link to be shared on Twitter, as a tweet. utm_source parameter identifies the source of traffic this could be a site, a social media network, newsletter, app, etc. Therefore, as a Twitter marketer who needs to track link performance, you should use bit.ly. Check out our review of this fantastic tool to see how it works.