[MOD] Woopra Analytics Module

Modules, Add-ons and custom code that's more than just a quick hack or Mod.
Post Reply
Martin
Site Admin
Site Admin
Posts: 1854
Joined: Wed Jun 17, 2009 6:30 pm
Location: South Yorkshire UK
Contact:

[MOD] Woopra Analytics Module

Post 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.
Attachments
WoopraFB-1.0.1.zip
Woopra (FacebookLB adapted) ver 1.0.1
(16.9 KiB) Downloaded 721 times
Martin
Site Admin
Site Admin
Posts: 1854
Joined: Wed Jun 17, 2009 6:30 pm
Location: South Yorkshire UK
Contact:

Re: Woopra Analytics Module

Post 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
jesterstrickbits
Posts: 18
Joined: Thu Dec 09, 2010 8:47 am
Location: somewhere sunny :-P
Contact:

Re: [MOD] Woopra Analytics Module

Post 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
Tracey

http://www.jesterstrickbits.co.uk
Aftermarket accessories for motorcycles, track bikes and streetfighters
Follow us on twitter http://www.twitter.com/jesterstb
A man is as good as he has to be and a woman as bad as she dares
jesterstrickbits
Posts: 18
Joined: Thu Dec 09, 2010 8:47 am
Location: somewhere sunny :-P
Contact:

Re: [MOD] Woopra Analytics Module

Post 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!
Tracey

http://www.jesterstrickbits.co.uk
Aftermarket accessories for motorcycles, track bikes and streetfighters
Follow us on twitter http://www.twitter.com/jesterstb
A man is as good as he has to be and a woman as bad as she dares
Martin
Site Admin
Site Admin
Posts: 1854
Joined: Wed Jun 17, 2009 6:30 pm
Location: South Yorkshire UK
Contact:

Re: [MOD] Woopra Analytics Module

Post 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 :)
Post Reply