summaryrefslogtreecommitdiff
path: root/addons/website/static/src
diff options
context:
space:
mode:
authorHiral Bhavsar <hbh@odoo.com>2017-04-06 15:12:01 +0200
committerYannick Tivisse <yti@odoo.com>2017-06-19 17:37:38 +0200
commit100ab909e6516b5026bb3d2113f39fca3c4f6f86 (patch)
tree79fd125baa4d6556cd41f1ab465cc90e1ba85801 /addons/website/static/src
parente331c0bd19c4738b5646bb6fe9ccb959e14b3d9d (diff)
[IMP] website: Restructure the 'Google Analytics' wizard.
* Set the blocking warning if the user enters a 'Client ID' without any 'Tracking ID'. * 'Google Analytics in Dashboard' field is visible only if 'Google Analytics' is checked in website settings. * Get/Set the value of 'google_analytics_key' and 'google_management_client_id' from 'website' model instead of 'ir.config_parameter' on 'Google Analytics' wizard. * If ID is set on 'Google Analytics' wizard then activated the related features and populate fields in website settings.
Diffstat (limited to 'addons/website/static/src')
-rw-r--r--addons/website/static/src/js/website.backendDashboard.js15
-rw-r--r--addons/website/static/src/xml/website.backend.xml11
2 files changed, 19 insertions, 7 deletions
diff --git a/addons/website/static/src/js/website.backendDashboard.js b/addons/website/static/src/js/website.backendDashboard.js
index f5c9c6b7b2f..f1dcdf6a6ec 100644
--- a/addons/website/static/src/js/website.backendDashboard.js
+++ b/addons/website/static/src/js/website.backendDashboard.js
@@ -76,7 +76,10 @@ var Dashboard = Widget.extend(ControlPanelMixin, {
var dialog = new Dialog(this, {
size: 'medium',
title: _t('Google Analytics'),
- $content: QWeb.render('website.ga_dialog_content', {ga_key: this.dashboards_data.visits.ga_client_id}),
+ $content: QWeb.render('website.ga_dialog_content', {
+ ga_key: this.dashboards_data.visits.ga_client_id,
+ ga_analytics_key: this.dashboards_data.visits.ga_analytics_key,
+ }),
buttons: [
{
text: _t("Save"),
@@ -84,7 +87,8 @@ var Dashboard = Widget.extend(ControlPanelMixin, {
close: true,
click: function() {
var ga_client_id = dialog.$el.find('input[name="ga_client_id"]').val();
- self.on_save_ga_client_id(ga_client_id);
+ var ga_analytics_key = dialog.$el.find('input[name="ga_analytics_key"]').val();
+ self.on_save_ga_client_id(ga_client_id, ga_analytics_key);
},
},
{
@@ -95,12 +99,13 @@ var Dashboard = Widget.extend(ControlPanelMixin, {
}).open();
},
- on_save_ga_client_id: function(ga_client_id) {
+ on_save_ga_client_id: function(ga_client_id, ga_analytics_key) {
var self = this;
return this._rpc({
- route: '/website/dashboard/set_ga_client_id',
+ route: '/website/dashboard/set_ga_data',
params: {
- 'ga_client_id': ga_client_id
+ 'ga_client_id': ga_client_id,
+ 'ga_analytics_key': ga_analytics_key,
},
}).then(function (result) {
if (result.error) {
diff --git a/addons/website/static/src/xml/website.backend.xml b/addons/website/static/src/xml/website.backend.xml
index a30267af9a8..9abb82e0e49 100644
--- a/addons/website/static/src/xml/website.backend.xml
+++ b/addons/website/static/src/xml/website.backend.xml
@@ -92,8 +92,15 @@
</div>
<div t-name="website.ga_dialog_content">
- Your Google Analytic Client ID: <input type="text" name="ga_client_id" t-att-value="ga_key" style="width: 100%"></input>
- <br/>Go to our <a href="https://www.odoo.com/documentation/user/online/website/optimize/google_analytics.html" target="_blank">User Documentation</a> to get more information.
+ Your Tracking ID: <input type="text" name="ga_analytics_key" placeholder="UA-XXXXXXXX-Y" t-att-value="ga_analytics_key" style="width: 100%"></input>
+ <a href="https://www.odoo.com/documentation/user/online/website/optimize/google_analytics_dashboard.html" class="oe_link fa fa-arrow-right" target="_blank">
+ How to get my Tracking ID
+ </a>
+ <br/><br/>
+ Your Client ID: <input type="text" name="ga_client_id" t-att-value="ga_key" style="width: 100%"></input>
+ <a href="https://www.odoo.com/documentation/user/online/website/optimize/google_analytics_dashboard.html" class="oe_link fa fa-arrow-right" target="_blank">
+ How to get my Client ID
+ </a>
</div>
<t t-name="website.DateRangeButtons">