WordPress.org

Ready to get started?Download WordPress

Forums

Google Analytics for WordPress
Enhanced Link Attribution (3 posts)

  1. James Barlow
    Member
    Posted 1 year ago #

    Something I've been experimenting with recently is the option for Enhanced Link Attribution (within Google Analytics, Profile -> Property Settings. Check the relevant box).

    You can tag your pages to implement an enhanced link-tracking functionality that lets you:

    See separate information for multiple links on a page that all have the same destination. For example, if there are two links on the same page that both lead to the Contact Us page, then you see separate click information for each link.

    See when one page element has multiple destinations. For example, a Search button on your page is likely to lead to multiple destinations.

    Track buttons, menus, and actions driven by javascript.

    More details from Google here:
    https://support.google.com/analytics/bin/answer.py?hl=en&utm_id=ad&answer=2558867

    You can add this to the Yoast plugin by amending the file

    /wp-content/plugins/google-analytics-for-wordpress/frontend/class-frontend.php

    (Line 273 in current release. Look for the first reference to the _gaq variable)

    <script type="text/javascript">//<![CDATA[
                // Google Analytics for WordPress by Yoast v<?php echo GAWP_VERSION;  ?> | http://yoast.com/wordpress/google-analytics/
                var _gaq = _gaq || [];
    			var pluginUrl = '//www.google-analytics.com/plugins/ga/inpage_linkid.js';
    			_gaq.push(['_require', 'inpage_linkid', pluginUrl]);
                _gaq.push(['_setAccount', '<?php echo trim( $this->options["uastring"] ); ?>']);

    It would be really handy if this could be available as a configurable option in a future release of the plugin. Needs an extra option defined on the admin screen and some conditional logic to insert the extra two lines (which are not profile-specific)

    http://wordpress.org/extend/plugins/google-analytics-for-wordpress/

  2. dmpp
    Member
    Posted 1 year ago #

    Thanks for this. I also hope that they update the plugin to include this function...

  3. baeldung
    Member
    Posted 1 year ago #

    This would indeed be very useful.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic