[IMP] Add support for Google Analytics

bzr revid: ddm@openerp.com-20140121163456-i3v3a7oh8qejc9oo
This commit is contained in:
ddm@openerp.com 2014-01-21 17:34:56 +01:00
parent 87d6f608da
commit 1c3a7a8fd3
4 changed files with 13 additions and 1 deletions

View File

@ -117,6 +117,7 @@ class website(osv.osv):
'social_linkedin': fields.char('LinkedIn Account'),
'social_youtube': fields.char('Youtube Account'),
'social_googleplus': fields.char('Google+ Account'),
'google_analytics_key': fields.char('Google Analytics Key'),
'public_user': fields.function(_get_public_user, relation='res.users', type='many2one', string='Public User'),
'menu_id': fields.function(_get_menu, relation='website.menu', type='many2one', string='Main Menu',
store= {

View File

@ -340,7 +340,7 @@
canEditDescription: false,
canEditKeywords: false,
maxTitleSize: 65,
maxDescriptionSize: 160,
maxDescriptionSize: 150,
start: function () {
var self = this;
var $modal = self.$el;

View File

@ -197,6 +197,16 @@
</div>
</footer>
</div>
<t t-if="website.google_analytics_key">
<script>
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='//www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','<t t-esc="website.google_analytics_key"/>');ga('send','pageview');
</script>
</t>
</body>
</html>
</template>

View File

@ -51,6 +51,7 @@
<field name="social_linkedin" placeholder="http://www.linkedin.com/company/openerp"/>
<field name="social_youtube" placeholder="http://www.youtube.com/channel/HCU842OHPPNrQ"/>
<field name="social_github" placeholder="https://youraccount.github.io"/>
<field name="google_analytics_key" placeholder="UA-XXXXXXXX-1"/>
</group>
<group string="Other Info">
<field name="company_id" groups="base.group_multi_company"/>