Page 1 of 1

[MOD] Woopra Analytics Module

Posted: Thu Feb 17, 2011 7:08 pm
by Martin
This module is specifically for anyone who uses Woopra for their realtime analytics service and adds a little extra functionality to make it easier to track who, what, etc...

This is version #1 and it's something I knocked up in an hour of messing around with API's and the like so it's freely available (not for re-sale) BUT I would appreciate anyone using it putting their hands in their pocket and donating £10 ($15) or more to a charity by way of thank-you... Good deeds should be rewarded or at least paid forward... but I'll let you conscience and the knowledge that Karma generally wins out guide you on that one ;)


Right... code:

Open: /templates/__master/Panels/HTMLHead.html

Find & CUT (Delete)

Code: Select all

	<!-- Include visitor tracking code (if any) -->
	%%GLOBAL_TrackingCode%%
Find:

Code: Select all

	<script type="text/javascript" src="%%GLOBAL_ShopPath%%/javascript/jquery.js?%%GLOBAL_JSCacheToken%%"></script>
After, PASTE (Add):

Code: Select all

	<!-- Include visitor tracking code (if any) -->
	%%GLOBAL_TrackingCode%%

Open: /includes/display/HTMLHead.php

Find:

Code: Select all

		// Include the tracking code for each analytics module
		$GLOBALS['TrackingCode'] .= GetTrackingCodeForAllPackages();
BEFORE, Add:

Code: Select all

		// MOD Woopra Analytics
		if(CustomerIsSignedIn()) {

				// If they're a customer, set their name so it's available in the templates
				$c = GetClass('ISC_CUSTOMER');
				$customerData = $c->GetCustomerDataByToken();
				$GLOBALS['CurrentCustomerFirstName'] = isc_html_escape($customerData['custconfirstname']);
				$GLOBALS['CurrentCustomerLastName'] = isc_html_escape($customerData['custconlastname']);
				$GLOBALS['CurrentCustomerEmail'] = isc_html_escape($customerData['custconemail']);
		}
		// MOD END Woopra Analytics
Copy the following files (See attached) to the relevant folders and overwrite as appropriate (Make BACKUPS of original files FIRST).
  • Replace
    • /includes/classes/class.facebooklikebutton.php
    • /templates/__master/Snippets/FacebookLikeButton.html
  • Add
    • /modules/analytics/woopra (and contents)
Usage is pretty self explanatory and requires you to have a Woopra account (rather obvious)...


Functionality:
  • Provides a specific Woopra analytics code module (rather than having to hard code or use the GA one)
  • Auto tags Woopra visitors with their name, email and orderID when they complete an order
  • Auto tags Woopra visitors with their name when they are logged in [New Ver: 1.0.1]
  • Uses the facebook XFBML code instead of the iFrame version
  • Fires tracking event when the facebook "like" button is clicked
  • Only loads the FB code nugget if the FB functionality is enabled

Support for this module will be provided upon proof of a donation to a charity so you're on your own. That said, I am considering developing this further as a paid module in the future depending on a few other integrations I'm considering.

Re: Woopra Analytics Module

Posted: Thu Feb 17, 2011 10:15 pm
by Martin
Did a bit more digging and found that it's possible to apply another modification and get customer name data (I've deliberately NOT pulled the available email data to avoid freaking anyone out, if they check source code for any reason) into the GLOBALs array, read by Woopra and applied to the visitor tag.

Changes being applied to the original post above.

Version 1.0.1

Re: [MOD] Woopra Analytics Module

Posted: Mon Feb 21, 2011 2:43 pm
by jesterstrickbits
Thanks for sharing, Martin.

Have implemented and will let you know how I get on (and who I donate to, of course. Jab me if I forget to mention!)

Have had problems with getting Woopra account working but it does seem to be partially funtional now (although iphone app still saying we have no sites registered! :roll: ) so it'll be interesting to start seeing some results

Re: [MOD] Woopra Analytics Module

Posted: Thu Mar 17, 2011 3:14 pm
by jesterstrickbits
hey, nobody jabbed me!

I'd forgotten about this (I don't tend to monitor the Woopra stats. Hubby and 11yo are equally obsessed with stalking our online customers and I don't get a look in LOL)

Donation made for Comic Relief via the Radio 1 Chris Moyles Radio 1's longest show ever thingumyjig
Have you seen how well he's done?
Awesome!
Over half a million quid already!

Re: [MOD] Woopra Analytics Module

Posted: Thu Mar 17, 2011 3:39 pm
by Martin
jesterstrickbits wrote:hey, nobody jabbed me!
Well, I am married!! :)
I'd forgotten about this (I don't tend to monitor the Woopra stats. Hubby and 11yo are equally obsessed with stalking our online customers and I don't get a look in LOL)

Donation made for Comic Relief via the Radio 1 Chris Moyles Radio 1's longest show ever thingumyjig
Have you seen how well he's done?
Awesome!
Over half a million quid already!
Glad it's proved useful and yes, listening to the show now... starting to slur a bit but definitely impressive.. He'll be fine if/when he becomes a dad :)