我在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
我该如何解决问题
答案 0 :(得分:0)
通过打开文件,可以轻松地将Google Analytics添加到您的opencart安装中:catalog / view / theme / {your template's name} /common/footer.tpl
或者如果是opencart 3.x 目录/视图/主题/ {您的模板名称} /common/footer.twig
在标记之前添加google analytics js代码。保存文件并上传。
store_id与此任务无关,除非您添加/安装了Google分析的扩展程序,该扩展程序将为每个商店提供Google分析代码(如果您使用的是opencart多存储功能)
答案 1 :(得分:0)
感谢您的回复。我解决了这个问题。似乎store_id变量未在google_analytics.php中定义 替换
$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);