Commit 88f45fe9 authored by Matija Obreza's avatar Matija Obreza

Include page variables for GA

parent 255d3200
......@@ -34,6 +34,7 @@
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '${googleAnalyticsAccount}']);
_gaq.push(['_trackPageview']);
_gaq.concat(_pageGaq || []);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
......
......@@ -242,12 +242,18 @@
</ul>
</c:if>
<c:if test="${accessionEnvironment ne null and accessionEnvironment.latitude ne null}">
<script type="text/javascript">
<script type="text/javascript">
<c:if test="${accessionEnvironment ne null and accessionEnvironment.latitude ne null}">
jQuery(document).ready(function() {
var accessionMap=GoogleMaps.map("${pageContext.response.locale.language}", $("#map"), { center: new GoogleMaps.LatLng(${accessionEnvironment.latitude}, ${accessionEnvironment.longitude}), markerTitle: "<spring:escapeBody javaScriptEscape="true">${accession.accessionName}, ${accession.instituteCode}</spring:escapeBody>" });
});
</script>
</c:if>
</c:if>
_pageGaq = [];
_pageGaq.push(['_setCustomVar', 1, 'Institute', '${accession.instituteCode}']);
_pageGaq.push(['_setCustomVar', 1, 'Genus', '${accession.genus}']);
<c:forEach items="${crops}" var="crop">_pageGaq.push(['_setCustomVar', 1, 'Crop', '${crop.shortName}']);
</c:forEach>
</script>
</body>
</html>
\ No newline at end of file
......@@ -134,6 +134,9 @@
markerTitle: "<spring:escapeBody javaScriptEscape="true">${faoInstitute.fullName}</spring:escapeBody>"
});
});
_pageGaq = [];
_pageGaq.push(['_setCustomVar', 1, 'Institute', '${faoInstitute.code}']);
</script>
</c:if>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment