Onsite targeting with Google Analytics

by Michael Whitaker on March 30, 2010

A logical progression from segmenting your data in web analytics is to then be able to target those segments. For example, you might want to show a special offer only to loyal repeat customers and not to others.

In a very informative webinar last week by the Google Analytics team on custom variables, one particular example caught my attention: the ability to not only set a custom variable, but also to read its value.

Let’s assume that I set a custom variable called CustomerType on the transaction page that has the possible values New or Repeat, then it sounds like we will be able to do something like this:

<script>var customertype = pageTracker._getVisitorCustomVar(1);
if (customertype = 'Repeat') {
display special offer on the page
}
</script>

The method _getVisitorCustomVar() is described in the GA code site. Cool stuff!

  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Twitter
  • FriendFeed
  • LinkedIn
  • PDF
  • Reddit

{ 4 trackbacks }

Tweets that mention Onsite targeting with Google Analytics -- Topsy.com
March 30, 2010 at 4:35 pm
Marketing Analytics Links of the Week – Marketing Analytics Blog
April 19, 2010 at 3:38 pm
Web analytics and conversion essentials > Smart Insights Digital Marketing
April 27, 2010 at 1:19 pm
Onsite personalization example with Google Analytics
April 28, 2010 at 2:39 pm

{ 3 comments… read them below or add one }

James Dutton March 31, 2010 at 1:52 am

Michael,

This looks very promising – especially if you were to tie this kind of data driven targeting with a split / mv test from website optimizer.

I noticed you said ‘it sounds like…’ – have you been able to test the code yet to validate the approach works (it seems like it should based on all documentation I’ve seen).

Kudos for sharing this – I’m expecting you’re going to get a lot of traffic over the next few days on this!

Cheers, James.

Michael Whitaker March 31, 2010 at 6:55 am

Hi James,

At the time of the webinar I couldn’t find any documentation on _getVisitorCustomVar(), but it is here now http://code.google.com/apis/analytics/docs/gaJS/gaJSApiBasicConfiguration.html#_gat.GA_Tracker_._getVisitorCustomVar so it looks official now. Will start testing it out.

Cheers,
Michael

Kurt Illian April 28, 2010 at 10:42 am

Hey Michael,

Have you had a chance to test this feature out yet? Would love to hear if you’ve been able to get this to work and see any examples.

Best,
Kurt

Leave a Comment

Previous post:

Next post: