[IMP] Add support for Google Analytics
bzr revid: ddm@openerp.com-20140121163456-i3v3a7oh8qejc9oo
This commit is contained in:
parent
87d6f608da
commit
1c3a7a8fd3
|
@ -117,6 +117,7 @@ class website(osv.osv):
|
||||||
'social_linkedin': fields.char('LinkedIn Account'),
|
'social_linkedin': fields.char('LinkedIn Account'),
|
||||||
'social_youtube': fields.char('Youtube Account'),
|
'social_youtube': fields.char('Youtube Account'),
|
||||||
'social_googleplus': fields.char('Google+ 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'),
|
'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',
|
'menu_id': fields.function(_get_menu, relation='website.menu', type='many2one', string='Main Menu',
|
||||||
store= {
|
store= {
|
||||||
|
|
|
@ -340,7 +340,7 @@
|
||||||
canEditDescription: false,
|
canEditDescription: false,
|
||||||
canEditKeywords: false,
|
canEditKeywords: false,
|
||||||
maxTitleSize: 65,
|
maxTitleSize: 65,
|
||||||
maxDescriptionSize: 160,
|
maxDescriptionSize: 150,
|
||||||
start: function () {
|
start: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
var $modal = self.$el;
|
var $modal = self.$el;
|
||||||
|
|
|
@ -197,6 +197,16 @@
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
<field name="social_linkedin" placeholder="http://www.linkedin.com/company/openerp"/>
|
<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_youtube" placeholder="http://www.youtube.com/channel/HCU842OHPPNrQ"/>
|
||||||
<field name="social_github" placeholder="https://youraccount.github.io"/>
|
<field name="social_github" placeholder="https://youraccount.github.io"/>
|
||||||
|
<field name="google_analytics_key" placeholder="UA-XXXXXXXX-1"/>
|
||||||
</group>
|
</group>
|
||||||
<group string="Other Info">
|
<group string="Other Info">
|
||||||
<field name="company_id" groups="base.group_multi_company"/>
|
<field name="company_id" groups="base.group_multi_company"/>
|
||||||
|
|
Loading…
Reference in New Issue