With its own URL shortener, you can ensure that your long links are kept safe and secure for your visitors. Bitly will assign a shortened/customized URL for all the links you add to the bundle. More over, all these statistics & reports come with no cost. 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.
Use a smart link to detect language preference of visitor and automatically route to either our English content or Spanish content. For example: Services Brochure In the above URL we’ve added the parameter “?pdf=Services-Brochure” to the end of the PDF URL link.
To find each combination's unique web ID, follow these steps. Enabling this setting records and displays the following additional link information: URL: Displays the URL that will be tracked. Twitter.com: The truth is that the best URL shortener for Twitter is the one that’s built into Twitter. Google Analytics doesn’t “listen” for link click events by default, so that’s why we have to go the extra work of creating a link click listener tag. You are also able to use the same tools such as bookmarklets and third-party apps using their API with your custom domain name. The trickiest part of tagging links in an email is coming up with a consistent naming convention for each variable.
Keys can be generated in base 36, assuming 26 letters and 10 numbers. Many URL-shortener services offer the option to track how many clicks each link gets. They keep URLs that are loaded with UTM tracking tags from looking ugly by hiding the length and characters in the UTM tracking system. Is there more than one type of Google Analytics tracking on your links? If you combine MailChimp's Google Analytics tracking with custom UTM tracking, this could skew results in reports. This is a nice extra feature if branding is important to you or if you want to make your link easier to memorize. In the publisher interface, they can find the offer tracking link on the offer's page: Adding Sub ID and Source Parameters HasOffers can create a session and redirect the user to the offer URL using only the information above.
Some link shorteners allow custom domains, and some don’t. URLs that are shortened with the bitly service use the bit.ly domain or any other generic domain that the service offers.[citation needed]Information about any short bitly URL is available at (that is, the URL with a plus sign appended), for example .[8] This allows users to see and check the long URL before visiting it. In this case you can use Google’s Disavow Link tool in Google Webmaster Tools to let Google know that you don’t approve of that link. Click Macro Redirect You can specify a custom click macro by first enabling the offer tracking setting, and then passing in a URL using the following parameter: redirect For this parameter, you can include either the {redirect} or {eredirect} macro to track your clicks in another tracking system. Use alternate extensions "hacks": Many country code extensions can be used to help form your company name by using the characters before and after the dot to form a shortened for similar sounding version of your name. Short URLs, for example, will be subject to linkrot if the shortening service stops working; all URLs related to the service will become broken. Twitter will use this to make your timeline better. So if you accidentally enter the wrong longer URL to the service, the new shorter URL can never be edited to associate it with a different longer URL.