Data Layers 101
Jono Alderson
Head of Insight @ Linkdex
@jonoalderson
Not a new
concept.
HUGE benefits...
But slow to take off
:(
Some History.
The Internet
wasn’t designed
for this.
Content,
presentation and
behaviour all
muddled up.
The ideal...
HTML
CSS
Content &
Markup
Layout &
presentation
Database + server-side
JavaScriptBehaviour
Logic &
processing
The modern web
HTML
CSS
Database + server-side
JavaScript
HTML
CSS
Database + server-side
jQuery
Better, but still
a mess.
And so...
“Can we add this
conversion script to all
form ‘thank you’ pages?”
How do we get better at
this?
Let’s get organised.
Container Tags
Great!
…until you want to do
something new.
Same principles
apply with other
solutions
Hook, trigger and
manipulate page
elements.
“Trigger a CTA if this is the first page the
user has seen”
But what about...
“Don’t trigger our retargeting code if the
product has a high returns rate”
or...
DOM hooks only get
you so far.
Introducing the Data Layer...
...Making it really freakin’ easy to manage
and turbo-charge your tagging* since 2012
*and other cool stuff
HTML
CSS
Database + server-side
JavaScript /
jQuery
Data
Data
It’s just a big array.
dataLayer : {
“number of tacos” : 12345
“colour” : “red”
“foods” : {
“meat” : “bacon”
“veg” : “carrot”
“starter” : “soup”
“courses” : 3
}
}
pageInfo: {
url: "http://www.example.com/category/article-name/"
author: "John Smith"
}
Pages written by a
specific author
category:{
primaryCategory: "Cameras",
subCategory1: "Nikon",
pageType: "ProductDetail"
}
Products in a
specific category
Specific page
templates
attributes:{
seasonal: "Christmas"
priority: "high"
returnFreq: "low"
} Attributes which aren’t
necessarily available
from/on the page
userInfo:{
pagesViews: 6
lastPage: "http://www.example.com/page/"
loggedIn: "false"
persona: “bargain hunter”
qualityScore: 2
gender: "female"
}
Server-side stuff which
you can expose and
use easily
Just imagine...
(An aside)
Enable Google Analytics demographic data NOW.
transactionInfo:{
"bookingDate" : "26/05/2014",
"departureDate" : "12/07/2014",
"bookingValue" : 155.45,
"productSkus": [ "100002", "100003", "100004" ]
}
Get that in your analytics
Chuck some API calls in
there, too (don’t forget
to cache)
Getting stuff out
Google Tag Manager,
javascript, ajax
“But we can already do all of this
kind of stuff…”
...but it’s sure as hell not flexible.
and it doesn’t anticipate unknowns
Next steps...
Now bring it to life.
Add things after page load
Clicks, mouseovers, dwell
times, behaviours, triggers
Anticipate what you need
Update as you go
This sounds like more work...
Standardisation
E.g.,
Generify the concept of ‘submitted’
Brief on scenario not specifics
Want to get really clever?
Server-side / ajax data layers
Keep sensitive data secret!
Summary
Care for your data, and it’ll change your world
Thanks!

Data layers 101