view src/main/webapp/google-analytics-snippet.xhtml @ 14:be7787c36e58 default tip

new: nofity LGSercies for deleted files
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 02 Nov 2015 16:41:23 +0100
parents a50cf11e5178
children
line wrap: on
line source

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:c="http://java.sun.com/jsp/jstl/core"
     xmlns:p="http://primefaces.org/ui"
     xmlns:o="http://omnifaces.org/ui"
     xmlns:jsf="http://xmlns.jcp.org/jsf">
    <script><!-- Google Analytics Snippet -->
               
        (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', "#{settingsServiceBean.get(':GoogleAnalyticsCode')}", 'auto');

          ga('send', 'pageview', {
            'hitType': 'social',
            'socialNetwork': 'facebook',
            'socialAction': 'send',
            'socialTarget': '#{systemConfig.dataverseSiteUrl}',
            'page': '#{systemConfig.pageURLWithQueryString}'
          }, {
            'hitType': 'social',
            'socialNetwork': 'twitter',
            'socialAction': 'tweet',
            'socialTarget': '#{systemConfig.dataverseSiteUrl}',
            'page': '#{systemConfig.pageURLWithQueryString}'
          });
	</script>
</ui:composition>