Wednesday 5 May 2010

Email campaign tracking with Silverpop

SilverPop offer themselves to the world as an "Engagement marketing solution". They provide click-stream and conversion tracking based on your email marketing campaigns, by putting unique identifiers in the links of your mailings (which they can send out in bulk). If you store these IDs and ping them back to SilverPop's click-stream and conversion-tracking servelets, this means you can get complete conversion analysis based on your email marketing campaigns.

@ Moneyspyder, one of our clients has signed up for a Silverpop account - which means we need a way to easily integrate with SilverPop - and the examples they give are all in php (and a little less than dynamic). So here's our Ruby-on-Rails solution.

1) Cookify the IDs

When a customer clicks on a link in one of the SilverPop emails - Silverpop has cleverly adding tracking IDs to identify the mailing-job and individual customer. When we send tracking information back to SilverPop - we need to send back these ids so the click-tracking is stored against the correct campaign and individual.

Of course, the parameters will disappear after the first time the user clicks another link, and we need to persist the data - to keep tracking all the pages they click on until they eventually convert!

The easiest way to keep track of this to stick it all into the session - then we can just check if it's there and send it each time we want to ping to SilverPop... and of course the best place to do session-wrangling is in a before_filter. So stick the following into something like application.rb

before_filter :save_silverpop_data_in_session

# This method does the storing of the ids from the URL into a session
# cookie for later sending.
# It will replace any existing values in the cookie - which represents the
# user having returned to the site after viewing (and clicking on) another
# link from a different email campaign.
def save_silverpop_data_in_session
if %w{spMailingID spUserID spJobID spReportID}.all? {|f| params.has_key?(f) }
session[:silverpop] = {:m => params[:spMailingID], :r => params[:spUserID],
:j => params[:spJobID], :rj => params[:spReportID]}
end
end

2) Configure your pod

SilverPop calls it's servers "pods" - and you could be using any one of them. This works better as a configuration option than hard-coded in your code - and lets you set up a link to the test-server on your dev/test environments. but in environment.rb you'll have something like this:

# SilverPop URL = mailing list manager/ClickStream Analysis
SILVERPOP_SITE_URL = "recp.rm05.net"

3) Helping hands

Next up is to figure out how to ping SilverPop... which they helpfully give us an img tag example of how to build up the correct url with all the requisite values.

SilverPop has two servelets - one for accepting pings for click-stream tracking and one for the conversions. But they're almost identical, just taking different parameters... and I'm lazy and don't want to have to remember all the common details of how to do this in each place in the site. Thus: helpers to the rescue!

# This method generates the code that calls the ClickStream tracking
# servelet - we pass in the page name and page URL, along with the values
# passed through from the last silverpop email - saved in the session
def silverpop_click_stream_ping(page_name, page_url)
silverpop_link('cst', :name => page_name, :s => page_url)
end

# This method generates the code that calls the Conversion Tracking
# servelet - we pass in the "action", "detail" and "value" flags -
# eg "silverpop_conversion_ping 'CompletedOrder', order.id, order.grand_total"
# along with the values passed through from the last silverpop email -
# saved in the session
def silverpop_conversion_ping(action,detail,value = nil)
silverpop_link('cot', :action => action, :detail => detail, :value => value)
end

# generate the SilverPop ping-image based on required servelet and parameters
def silverpop_link(servelet, options)
# skip out early if this user hasn't come through a silverpop email
return nil unless session[:silverpop].present?

image_tag "http://#{SILVERPOP_SITE_URL}/#{servelet}?#{session[:silverpop].merge(options).to_query}",
:height => 1, :width => 1, :alt => "Silverpop #{servelet.upcase} Servelet Ping"
end


4) Click-stream - analyse!

So, now it's time to get down and dirty with the click-stream analysis. This couldn't be more simple. Just use the helper to pop a link into your main layout. eg:

>
<%= silverpop_click_stream_ping(@page_title, url_for(:only_path => false)) -%>

Now, as you can see, this mainly works by using our dynamic page-title and a link to the current-page (using the empty url_for trick). Note that if you leave off the "only_path=false" option it won't provide the hostname. This may be what you want if you want to roll up multiple mirrored domains. You'll also have to adjust the page-name parameter as necessary for the way you generate the page-title... but otherwise you're good to go and this means every page-click gets tracked back to SilverPop from now on.

With one caveat... if you have AJAX-updating, you may need to figure out a neato trick of putting the ping-link into the newly-generated page-pieces or these "clicks" won't get tracked as the layout won't see them as new pages. I'll leave that as an exercise for the reader as it's very site-specific.
5) Mine your conversion gold

Now only the final, and most important, part is left - tracking actual conversions.

A lot has already been written about what constitutes an important conversion for your site. I won't repeat it all here as you can track heaps, and it's really down to what is important for your business. So I'll pretend we only care about when a customer completes an order - which we know because they land on the "thank you" page.

Which means we need to pop a link to the COT servelet there and pass in the important details... nothing easier:

>
<%= silverpop_conversion_ping("Order Complete", @order.id, @order.grand_total) -%>

Now SilverPop will monitor our marketing mails from go to whoa - and even know which order they completed and, most important, how much money they ended up spending ... Gold!

Taryn East

Monday 15 February 2010

Analytics in Real Time - What IS A.R.T.?

Web Analytics in Real Time delivering functionality and value.

It is widely known that the percentage of websites using Google's or Yahoo's free Web Analytics is growing massively. With this explosive growth, the methodology of the typical analytics ninja has to change at an equally frenetic rate.

Eric Peterson blogged recently (The Coming Bifurcation in Web Analytics Tools) - Google Analytics alone is simply not enough for truly sophisticated web analytics.

Indeed, any analytics ninja worth their money employs a number of tools to deliver actionable insight and therefore value to businesses.

This blog post is going to describe a new offering from Moneyspyder that is being used in conjunction with Google Analytics (equally suitable for use with a whole suite of analytical tools) to deliver high value actionable insight but in real time!

Gasps of shock and horror! Is real time worth it? Is real time action possible from real time insight? Back in 2006, Avinash Kaushik blogged (Is Real-Time Really Relevant?):

The greatest gift the web gives you is the ability to fail faster.

So how fast is fast? Now? How does now sound? You can Tweet now...send 10,000 emails now....up your bid on a range of keywords now. Don't you need to measure and understand the performance of these measures now? Consider Avinash's take on real time insight actionability from 2006:

...is getting real-time data really relevant? Do you really need it?

Fair question but as mentioned above, given that we're marketing to our customers and our customers are responding to emails and searching in real time, real time actionability is now strongly relevant and necessary. The act of using websites isn't after all an asynchronous activity!

The FUD (Fear, Uncertainty & Doubt) issues can be summarised:
- Do we need more data?
- Is actionable insight delivered in real time or are we just setting up another
useless reporting stream?
- Our current choice of analytics solution doesn't do real-time so what is the business case for changing to a potentially inferior real-time capable solution?
- Surely more powerful resource is required to provide the real-time capability?
- Don't we need more business processes to handle real-time action?
- A culture of reporting rather than analysis is going to be created!

Thus the gnashing of teeth seeks to extinguish the real time flame. In response:

Current free analytics solutions are not geared up to deliver actionable insights at the same velocity as our marketing efforts. That is not to say throw your current solution in the trash – far from it. Using the right tool for the right job is why we are using a suite of tools already:

- Analysis of click stream data
- Competitive Intelligence
- Voice of customer

None of which are geared to enable you to respond as quickly as you should be able to so another weapon is required in our armoury. One that is easy to use. One that is benign, safe, secure, scalable, value for money, fits with our current processes but above all, delivers actionable insights not just reports!
So, enter A.R.T...Analytics in Real Time.

A.R.T. makes no apologies for it's operation being based on existing great engineering ideas. These simple building blocks deliver a hugely functional product that is an utter no-brainer to use. The out-of-the-box setup requires a javascript include line in the page header and nothing else. It is benign in operation. It won't mess with your pages or affect your site speed.

Outcome-centric
A.R.T. is outcome-centric. The insights stem from the focus on measuring your website's ability to do what you wanted it to

- measure sign ups
- basket/cart actions
- searches
- posting comments
- form completion
- scrolling or any other dom event
- all things selling!
- Sales AND revenue

A.R.T. is not just any old reporting tool spouting vanity metrics. Real value stems from seeing a return on your investment. A.R.T. is the frontline tool that enables you tune finely tune your business to respond to realtime demands. A.R.T. doesn't try to replace your current analytics solution, although it is a great companion. We are quite strict on the amount of data that is held and for how long. The insights that A.R.T. yields can be extracted from your current analytics tools so A.R.T. will only ever hold a rolling 24 hour window of your clickstream and outcome data. Need more? Go to Yahoo/Omniture/Google/other weapon of choice.

Flexible & Customisable
Flexibility and customisability stem from the small number of moving parts in the system. A.R.T can be as sophisticated or vanilla as you need or want. Your challenge is to engage A.R.T. system in valuable insight revealing metric gathering endeavours.

Scalable infrastructure
A.R.T. is built using Ruby on Rails and is hosted on highly scalable cloud based infrastructure.

Processes to support change and build a test driven culture
Marketing in realtime clearly requires processes to support realtime action based on realtime results. Clearly, given we have processes in place in our organisations that enable marketing in realtime, we have the ability to act in realtime already! The necessary change that allows action and capitalisation on realtime insight is a cultural shift towards test driven optimisation. Contemporary software development methodology promotes rapid action and optimisation based on measured results – think Agile. A.R.T. Provides a feedback loop that enables rapid optimisation in a similar fashion. Consider firing out 3 variations of an email – 3 small batches at the time of known peak traffic levels. A small, low cost, low risk (due to small numbers) test like this would generate real-time actionable insight into which version of the email works best in terms of the desired outcome. Obviously, statistical significance is required before committing to a more risky or expensive course of action but this caveat exists for the current marketing/analytics process. So, having engaged in a cycle of 'release and refactor' we have what looks like a process that could deliver optimised value from future campaigns.

Rinse and repeat. Thanks A.R.T. ;-)

A summary of A.R.T.:

What does it do?
• Visit, visitor and pageview metrics - Who, What, Where, When and How?
• Outcome metrics with hourly breakdown - What is really important and really happening?
• Definable - YOU decide what your site is supposed to do and measure it!
• Revenue metrics with hourly breakdown
• 24 hour rolling window of data - need more? Go to your current analytics provider
• Traffic source data - Measure marketing in Real Time!
◦ campaign awareness through utm tagging
◦ Search engine metrics & keywords
◦ Referring sites - who loves you baby?!
• Individual customer identification, technical, loyalty & recency data - Love your top customers - personally
• Clickstream capture, analysis and replay
• Flexible page event definition – pageview, scroll, add to basket
• Filterable data – exclude/hide internal clickstream data
• Mobile interface – iPhone and Android - Real-Time and on-the-go!

Who is it for?
• Marketeers
• C level execs
• Technicians
• Content managers
• Business Owners

What does it cost?
The basic unit of currency for A.R.T. is the page view, hence, the fairest, most scalable pricing model is based on the number of pageviews per month and the length of the contract.

There is no limit on the number of pageviews with A.R.T. The infrastructure and costs scale according to your usage.

There is no advertising in the pricing model. The focus is on delivering insight, not just data or reports but real actionable insight to help you improve your business.

Monday 4 January 2010

Moneyspyder exceeds targets in 2009.

Happy New Year!

Last year was certainly a good one - 2010 is set to be even better. It'll be Spring soon - warmer weather, more daylight and more records to break.

Moneyspyder exceeded many targets last year. We were delighted with the resilience and scalability of all our clients' sites during the festive period (as were our clients!). The run up to Christmas saw new ground broken in terms of scalability, performance and transactional throughput.

Overall, 2009 saw 99.96% uptime across all our clients. Bearing in mind that the majority of that miserly amount of downtime was planned. Our twice monthly scheduled upgrades of sites are timed and performed with precision so as to maximise effect and return whilst minising interruption and downtime. We don't miss opportunities to introduce new A/B and Multivariate tests with Google Website Optimiser based on our deep dive analytics.

It has to be said that our infrastructure partners played a huge part in our success during 2009. A 'big shout out' to Site Confidence for the monitoring and uptime reporting and especially Engine Yard for the AWESOME Rails hosting. We're delighted to be part of Engine Yard's Select Partner Programme and look forward to moving onwards an upwards with all our client's and partners in 2010!