One of the most commonly asked question was how to track links in WordPress using Google Analytics? Twitter will use this to make your timeline better. Saving the Anchor Text with a Macro We’ll want to save the anchor text of the link. Bit.ly, which is what we integrate with in CoSchedule, uses a 301 redirect. Twitter will use this to make your timeline better. D) The Anchor Text they're using E) Links that are just discovered (a new, awesome feature in OSE) Using this information you can get a better idea of who is already linking to you in order to reach out and connect.
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. Our favorite is YOURLS, but Lessn More is another good free option.
Once you are sure that your WordPress site does not have Google Analytics code, go to Settings » Google Analytics. The service imports all of your short URLs and stores them and will also take over your URL shortening domain if you decide to close it, ensuring links posted throughout the Internet continue to work.Own Your Short Links on Twitter bit.ly offers URL shortening and link tracking services. If you’re logged in you can also get the shortlink for any page on WordPress.com, there’s a link under the “Blog Info” menu in your admin bar. Check out the following URL shortening providers that you can get started with using right away. (P.
Redirects A short URL is not a web page on its own. It’s a good way to package up multiple links into one link.
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. With that said, if you do need to track your URLs, or you want alternative ways to post there are plenty of ways to do it: Bit.ly: Probably the most popular URL shortener for Twitter because it was one of the first to let you track your tiny URLs. These can be transmitted via one of three parameters on the tracker URL. Simply add one of those two services before your URL—j.mp/—and you'll quickly redirect to a page with the shortened version of your link ready to be copied or posted to a social network. The original URL produced a QR code that is too big to fit on the label so we shorten it first. Here is what the firing rules look like for this tag:Event Equals gtm.linkClick: You will want to use this rule for ANY and ALL link click events. Upload the certificate and its corresponding key. As an example of how link tracking works, if your site’s domain is example.com, your link domain might be set to link.example.com.