WordPress.org

Ready to get started?Download WordPress

Forums

Facebook Like plugin with Google Analytics tracking (4 posts)

  1. Fred
    Member
    Posted 3 years ago #

    Hi,

    Does anyone know of a Facebook Like button plugin that would automatically add Google Analytics tracking code to the resulting link from Facebook? The 'WP Tweet Button' plugin has this functionality for Twitter. I'm currently using the 'Facebook Like' plugin.

    Thanks,
    Fred

  2. ninepointten
    Member
    Posted 3 years ago #

    I havent found a plugin but this article shows you how to do it manually:

    http://www.websharedesign.com/blog/how-do-i-track-that-little-facebook-like-button-in-google-analytics.html

  3. Fred
    Member
    Posted 3 years ago #

    Thanks, I've seen that article too. I would like to use that method, however, I'm not sure how to write the code to dynamically change the URL to be liked so that it changes for each post and always appends the tracking parameters. Do you know?

  4. maxhodges
    Member
    Posted 3 years ago #

    not working yet, but think i'm geting close

    <fb:like action='like' onclick="javascript: _gaq.push(['_trackEvent', 'Likes', 'fb-like', '<?php echo urlencode(get_permalink($post->ID));?>'])" colorscheme='light' href="<?php echo urlencode(get_permalink($post->ID).'?utm_source=facebook&utm_medium=social&utm_campaign=like'); ?>"
    layout='standard' show_faces='true' width='300'/>

Topic Closed

This topic has been closed to new replies.

About this Topic