Post by dragonfly-ie » Fri May 27, 2016 2:21 am

Using original theme and clean oc v2.2.

> Extensions > Analytics > Google Analytics Code enabled
When entering code:

Code: Select all

<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-xxxxxxxx', 'auto');
  ga('send', 'pageview');
</script>
I get error msg upon saving:
Notice: Undefined index: store_id in .../admin/controller/analytics/google_analytics.php on line 13
Warning: Cannot modify header information - headers already sent by (output started at .../admin/controller/startup/error.php:34) in .../system/library/response.php on line 12
??? ??? ??? ???

In google real-time traffic reports, analytics_test seems to be working. Why the error? or is it a bug?
Last edited by dragonfly-ie on Mon May 30, 2016 7:04 am, edited 1 time in total.

Dum spiro spero.


User avatar
New member

Posts

Joined
Sat Nov 09, 2013 2:31 am


Post by chipmaestro » Sun May 29, 2016 12:43 am

I'm also getting this... anyone know of a solution?

Newbie

Posts

Joined
Sat Jun 07, 2014 8:50 pm


Post by straightlight » Sun May 29, 2016 1:47 am


Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by fido-x » Sun May 29, 2016 12:10 pm

WRONG SOLUTION!

By removing the store_id, you can only set the Google Analytics for the default store.

Use the solution posted at viewtopic.php?f=191&t=160302. Not only does it provide the fix to the problem, it also explains why the problem exists in the first place.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by straightlight » Mon May 30, 2016 4:30 am

fido-x wrote:
WRONG SOLUTION!

By removing the store_id, you can only set the Google Analytics for the default store.

Use the solution posted at viewtopic.php?f=191&t=160302. Not only does it provide the fix to the problem, it also explains why the problem exists in the first place.
In both situations, as explained on my topic is that the store_id could not be found anywhere else on that file which means that variable was running on its own rather than relying on an origin. Removing the request post or removing the store_id would of worked both ways since you explained on your topic that the post has to be removed on anyhow. Which means, my topic does not necessarily leads to a wrong solution but rather an alternate solution.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by dragonfly-ie » Mon May 30, 2016 6:50 am

Thanks, lads.
Both are good solutions.
Since I don't multi-store the alternate solution is doing the trick for me.
Much appreciated. 8)

Dum spiro spero.


User avatar
New member

Posts

Joined
Sat Nov 09, 2013 2:31 am


Post by nasirkhan » Tue Jul 26, 2016 3:10 pm

tried both solutions but the Google analytics code is not visible on my website.

Nasir Khan Saikat
http://nasirkhn.com


Newbie

Posts

Joined
Tue Jul 26, 2016 2:17 pm
Location - Dhaka, Bangladesh

Post by kamarad » Wed Sep 21, 2016 6:26 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
Who is online

Users browsing this forum: No registered users and 15 guests