Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
51 lines (42 sloc) 1.92 KB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<title></title>
</head>
<body>
<!-- Include both these scripts or copy them into your main JavaScript file -->
<!--[if lt IE 10]>
<script type="text/javascript" src="http://veddecode.opensource.dpo.org.uk/js/base64-1.1.min.js"></script>
<![endif]-->
<script type="text/javascript" src="http://veddecode.opensource.dpo.org.uk/js/ved_analytics-1.1.min.js"></script>
<script type="text/javascript">
// Use this code with (the new) Universal Analytics (analytics.js)
// Standard Google code to load analytics.js
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXXXX-X', 'auto'); // Your Analytics property ID
// The custom variable code needs to go *before* recording the pageview
(function(w) {
if (w.VedDecode && w.VedDecode.ved) {
// Send pageview with custom dimension data
ga('set', {
dimension1: getVedValue('linkIndex'),
dimension2: getVedValue('linkType'),
dimension3: getVedValue('resultPosition'),
dimension4: getVedValue('subResultPosition'),
dimension5: getVedValue('page')
});
}
function getVedValue(key) {
var ret = w.VedDecode[key];
return ret ? ret + '' : '(not set)';
}
})(window);
ga('send', 'pageview'); // Record the pageview last of all
</script>
</body>
</html>