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
ninepointten
Member
Posted 1 year 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?
maxhodges
Member
Posted 1 year 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'/>