Page 1 of 1

Google Analytics Error

Posted: Wed May 04, 2016 4:37 am
by silkcamel
Dear All,

I created the google analytics account, and installed the google analytics in Opencart 2.2.0.0,

Pasted the code, after I click save there is an error:

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

anybody can help on this issue? Thanks.

Re: Google Analytics Error

Posted: Wed May 04, 2016 4:51 am
by straightlight
Since I do not see anywhere else on that file where the store_id is being used,

In admin/controller/analytics/google_analytics.php file,

find:

Code: Select all

$this->model_setting_setting->editSetting('google_analytics', $this->request->post, $this->request->get['store_id']);
replace with:

Code: Select all

$this->model_setting_setting->editSetting('google_analytics', $this->request->post);
This should resolved the problem.

Re: Google Analytics Error

Posted: Thu May 05, 2016 6:59 am
by doktorek
Thanks. I dont know about the OP but it worked for me.

Re: Google Analytics Error

Posted: Mon May 30, 2016 4:28 pm
by dragonfly-ie
Thanks a lot. Works perfectly for single store. 8)

See multi-store solution here: http://forum.opencart.com/viewtopic.php?f=191&t=160302

Re: Google Analytics Error

Posted: Tue Jul 26, 2016 4:04 pm
by nasirkhan
tried both of the solutions but the Google Analytics cod is not visible on the website.

Re: Google Analytics Error

Posted: Wed Sep 21, 2016 6:23 pm
by kamarad
Hello

Those codes that you enter is not in my google_analytics.php file?

In my google_analytics.php fil are only following code:

<?php
class ControllerAnalyticsGoogleAnalytics extends Controller {
public function index() {
return html_entity_decode($this->config->get('google_analytics_code'), ENT_QUOTES, 'UTF-8');
}
}


Why is it here?