Twitter tracking with Google Analytics using Twitter-Tools


6 Februarie 2009 - 12:51, 2 comentarii, 4,597 views
1 stea2 stele3 stele4 stele5 stele (2 voturi, media: 3 din 5)
Loading ... Loading ...
translate to english english version of this article
 

Tipareste acest postTipareste acest articol

For the WordPress bloggers that use Twitter Tools I made some modifications in /plugins/twitter-tools/twitter-tools.php at line 186 (line 480 at new version of this plugin, try to look for "$tweet->tw_text"). I inserted some tracking variables for Google Analytics

Making titles a long string without strange chars

$spaces = array(" ", "-", "!", "&", "’", "`", "?", "_");

$escapedtitle = str_replace($spaces, "", $post->post_title);

$link=get_permalink($post_id).’?utm_source=twitter&utm_medium=social-media&utm_campaign=’.$escapedtitle;

Instead of the original line at 187

$tweet->tw_text = sprintf(__($this->tweet_format, ‘twitter-tools’), $post->post_title, get_permalink($post_id));

I put this

$tweet->tw_text = sprintf(__($this->tweet_format, ‘twitter-tools’), $post->post_title, $link);

Reading these days this post written by Claudiu about tracking Twitter with Google Analytics and using for a long time ago Google URL Builder for tracking all my online marketing campaigns, I made this modifications in the plugin I use for updateing my twitters with my blog posts. If you don’t use Twitter Tools and use online services like TinyUrl to shortening your URLs use the script provided by Claudiu on his post.

You’ll find your statistics in GA / trafic sources / campaigns under source=TWITTER and medium=SOCIAL-MEDIA. After that you can track stats for each tweet, looking to campaigns titles = your post title w/o spaces and ohter strange chars. 

Another way to track your links is using this service, TwitClicks.com, which short your URLs but in the same time show you stats.

Keep an eye on your tweets!

No tags for this post. Discuta despre magazine online pe yahoo groups: Pentru a fi la curent cu ultimele articole, aboneaza-te la feed-ul RSS

2 Comentarii la “Twitter tracking with Google Analytics using Twitter-Tools”

  1. Posts about Twitter Plugins as of February 6, 2009 | The Lessnau Lounge Says:

    [...] about Twitter Plugins as of February 6, 2009 Twitter tracking with Google Analytics using Twitter-Tools – liviutaloi.ro 02/06/2009 For the WordPress bloggers that use Twitter Tools I made some [...]

  2. ltaloi Says:

    Test for measuring new comments as GOALS. I’ll be back with explanations soon.

Leave a Reply


Close
E-mail It
Valid XHTML 1.0 Transitional    
-->