Post by melkoala » Tue Mar 29, 2016 12:45 am

Hi

I am new to Opencart (V2.2) and have just entered my Google Analytics Code under Extensions/Analytics. However, when I save I get the following error:

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

Does anyone have any idea what the problem is and how I solve it?

Many thanks

Mel

Newbie

Posts

Joined
Tue Mar 29, 2016 12:42 am

Post by zerojinx » Tue Apr 12, 2016 5:44 am

I am having the same problem.

Michael Bielaczyc
http://www.aradanicostumes.com
http://www.aradani.com


New member

Posts

Joined
Fri May 07, 2010 11:17 am

Post by ostechnologies » Tue Apr 12, 2016 6:45 pm

It seems store_id variable is not defined in google_analytics.php

$this->request->get['store_id'] is calling in the google_analytics.php

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

Opencart Expert | sales[at]ost.agency
Skype - manish.osuniverse | Gtalk - manishmt

Extensions for Opencart @ https://www.ost.agency/product/product- ... extensions
ost.agency - ecommerce website design, development and digital company


User avatar
Active Member

Posts

Joined
Mon Apr 06, 2015 1:30 pm

Post by melkoala » Tue Apr 12, 2016 10:34 pm

Hi

That's great, thank you. All sorted now.

Kind regards

Mel

Newbie

Posts

Joined
Tue Mar 29, 2016 12:42 am

Post by maxcrist » Thu Jun 02, 2016 11:33 pm

Gracias desde Perú !!!

Newbie

Posts

Joined
Sat May 14, 2016 7:57 am

Post by msol » Sat Jun 25, 2016 2:07 pm

The code provided by google analytics is

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-79886521-1', 'auto');
ga('send', 'pageview');

</script>

Where do I find

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

Best Regards

Newbie

Posts

Joined
Wed Apr 13, 2016 5:10 am

Post by magikcommerce » Mon Jun 27, 2016 5:05 pm

In your OpenCart store directory go to admin/controller/analytics/google_analytics.php

You will find

Code: Select all

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

Browse large collection of Premium OpenCart Themes


User avatar
New member

Posts

Joined
Mon Feb 09, 2015 5:55 pm
Location - San Jose, CA

Post by kamarad » Wed Sep 21, 2016 7:39 pm

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?

Can someone help me?

Newbie

Posts

Joined
Sun Feb 14, 2016 6:09 am

Post by kamarad » Wed Sep 21, 2016 7:41 pm

Can anyone write down here all google_analytics.php?

Newbie

Posts

Joined
Sun Feb 14, 2016 6:09 am

Post by joecamel9166 » Mon Oct 03, 2016 11:21 am

@kamarad
ftp into your site and go to admin/controller/analytics/google_analytics.php
there you will see the code he is talking about.
Just did this and it worked fine.
OC 2.2

Newbie

Posts

Joined
Mon Aug 22, 2016 8:51 pm

Post by endesain » Thu Apr 13, 2017 1:10 pm

Great Post... Thank You..

Newbie

Posts

Joined
Thu Apr 13, 2017 1:08 pm
Who is online

Users browsing this forum: No registered users and 16 guests