Nick

MT-Twitter plugin - tracking referrals

Vote 0 Votes

I use Ian Fenn's MT-Twitter plug-in to tweet whenever I post an new entry and it works great. However in tweeting a post, I'd like the ability to include some additional query parameters on the base URL for the post. The main reason is so that I can check how well my Tweets perform at driving traffic to my site in whatever web analytics tool I use.

For example... Instead creating a tinyURL for the following post URL:

http://www.nickpotter.net/2008/09/pier-ing-into-the-future.php

I'd like to append some extra bits (these would be the same for all posts) like so:

http://www.nickpotter.net/2008/09/pier-ing-into-the-future.php?utmcampaign=blog&utmsource=twitter&utm_medium=micro-blog

This would allow me to track, using Google Analytics in this case, the twitter referrals as a campaign. Essentially all this would need is an option box to allow me to enter my custom query parameter extras in the plug-in setting screen so that they could be added before the URL is made into a TinyURL.

Does anyone know, is this something that is easy to do with the plug-in (i.e. a local tweak I can make) or does anyone have other suggestions on how this could be accomplished?

Reported on Movable Type 4.2

6 Replies

| Add a Reply
  • I can't see in the code anywhere that it automatically TinyURLs it... could it be the twitter API that does it for you? What's your twitter id, so i can see some examples of what it normally outputs.

    looks line line 110 is the one that actually creates the status line so you could append your extras there.

    I can't imagine it would be too much work to add QS parameters to the config, let me know if you'd like this and if you work out where it's getting tinyurl'd!

  • Just found this: "if you paste in a link that is less than 30 characters, we'll post it in its entirety. If it's longer than 30 characters, we'll convert it to a tiny URL."

    So it's Twitter that is converting the URL for you. In a way that makes it easier, because you just have to send it the longer URL. Would you prefer to edit Perl yourself or would you like me to do it?

    I may also knock up a modification of the plugin and send it to the author so that they can include it in their next release if they so wish.

    I would post a guide here of how to edit the code yourself, but the forums are eating all the code and formatting at the moment. I have your email address now so if you want me to send you a modified version of the plugin I can.

  • Thanks for your help Richard!

    I've managed to update it to allow the user to configure in the plug-in settings, what analytics tracking code they want to use and then amended the file to use whatever was saved in the settings, or a blank string if nothing was saved.

    If anyone wants the amended version of this plug-in let me know. I'll also continue to try to get in touch with the original creator to see if they want to add it to the next version.

  • I was debating using it, but the I realised I had 10 followers, so didn't see the point :D

    Put up a link if the author doesn't respond at all.

  • LOL - I've not got more followers than that but you have to start somewhere!

  • Nick, has Ian responded?

    If not I would be happy to merge the code into the next version of my HashTag plugin. It should not be difficult as it is based of mt-twitter anyway.

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

code.sixapart.com

137 479

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

238 797

Last Topic: Manifest Schema Compatibility Issue When Restoring Blog by Matt on Oct 17, 2012

1858 6594

Last Topic: Categories and Basename Publishing Issues by e21media on Oct 25, 2012

88 307

Last Topic: absolute publish date in Manage Entries screen by .mau. on Apr 18, 2012

1488 5347

Last Topic: Anti-cloning by .mau. on Oct 29, 2012

732 3093

Last Topic: Blog moved server - now users cannot access blog? by mowgs on Oct 30, 2012

89 317

Last Topic: How to "pretify" a url in htaccess with a few wildcards by Caio on May 30, 2012

183 771

Last Topic: Commenting with TypePad by Rob Ferrara on Oct 17, 2012

212 680

Last Topic: Does MT-Approval work in MT5? by DLpres on Sep 25, 2012

27 100

Last Topic: Upgrading MT by Caio on Oct 15, 2012

49 224

Last Topic: Movable Type 6 Ideas by Caio on May 28, 2012

65 248

Last Topic: Expanding new rich text editor and implementing table function by Takeshi Nick Osanai on Jul 30, 2012