0

我在 opencart 2.2.0 中集成 googleanlaytics,反映了一些错误

Notice: Undefined index: store_id in /home/domainname/public_html/test/admin/controller/analytics/google_analytics.php on line 13Warning: Cannot modify header information - headers already sent by (output started at /home/domainname/public_html/test/admin/controller/startup/error.php:34) in /home/domainname/public_html/test/system/library/response.php on line 12

我该如何解决这个问题

4

2 回答 2

0

感谢您的回复。我解决了这个问题。google_analytics.php 中似乎没有定义 store_id 变量 替换

$this->model_setting_setting->editSetting('google_analytics'‌​, $this->request->post, $this->request->get['store_id']); 

$this->model_setting_setting->editSetting('google_analytics'‌​, $this->request->post);
于 2017-08-25T10:06:15.813 回答
0

通过打开文件,可以轻松地将 Google Analytics 添加到您的 opencart 安装中:catalog/view/theme/{your template's name}/common/footer.tpl

或者如果它是 opencart 3.x 目录/视图/主题/{您的模板名称}/common/footer.twig

在标记之前添加你的谷歌分析 js 代码。保存文件并上传。

store_id 与此任务无关,除非您为谷歌分析添加/安装了一个扩展,该扩展将为每个商店提供一个谷歌分析代码(如果您使用的是 opencart 多商店功能)

于 2017-08-23T16:03:46.147 回答