Jump to content

[SOLVED] Google Analytics not working after upgrading to 1.5.4.1


Recommended Posts

Dear Friends,

 

i have re-made my website in the same URL using 1.5.4.1 and a paid theme which i customized heavily to fit my needs (mostly on the visual part).

 

At the end i installed the google analytics and i pasted the google ID that i had from the past (prestashop 1.0.5) and was working perfectly.

 

No change happened to the URL or anything else.

 

Google Analytics shows that it "receives data" but i cannot see any information there.

Either in the real time which as i understood, it should work immediately, neither in the general reports.

I have checked the source and indeed the analytics code is inserted normally by prestashop module.

 

Any idea what can be wrong?

 

Thank you.

Link to comment
Share on other sites

Dear Friends,

 

i have re-made my website in the same URL using 1.5.4.1 and a paid theme which i customized heavily to fit my needs (mostly on the visual part).

 

At the end i installed the google analytics and i pasted the google ID that i had from the past (prestashop 1.0.5) and was working perfectly.

 

No change happened to the URL or anything else.

 

Google Analytics shows that it "receives data" but i cannot see any information there.

Either in the real time which as i understood, it should work immediately, neither in the general reports.

I have checked the source and indeed the analytics code is inserted normally by prestashop module.

 

Any idea what can be wrong?

 

Thank you.

 

Well i will answer to myself.

I have fixed it.

Somehow i noticed that the ganalytics plugin was messing up what was supposed to be written on the page.

So, i simply deleted the references for the UAnalitics, i kept the original header.tpl file and i uploaded my own version and it works like a charm.

Somehow it was sending wrong code from the UAnalytics part and not from the old ganalytics part.

 

Here is how i modified it and it works super ok. My prestashop version is 1.5.4.1 - i remind - keep a back up of the original header.TPL file from inside the modules/ganalytics

For now i will not be using the UAnalytics so i am ok.

 

<script type="text/javascript">

 

        var _gaq = _gaq || [];

        _gaq.push(['_setAccount', '{$ganalytics_id}']);

        // Recommended value by Google doc and has to before the trackPageView

        _gaq.push(['_setSiteSpeedSampleRate', 5]);

        

        _gaq.push(['_trackPageview'{if isset($pageTrack)}, '{$pageTrack}'{/if}]);

        

        {if $isOrder eq true}            {* If it's an order we need more data for stats *}

            _gaq.push(['_addTrans',

                '{$trans.id}', {* order ID - required *}

                '{$trans.store}', {* affiliation or store name *}

                '{$trans.total}', {* total - required *}

                '{$trans.tax}', {* tax *}

                '{$trans.shipping}', {* shipping *}

                '{$trans.city}', {* city *}

                '{$trans.state}', {* state or province *}

                '{$trans.country}' {* country *}

              ]);

            

                {foreach from=$items item=item}

                    _gaq.push(['_addItem',

                        '{$item.OrderId}', {* order ID - required *}

                        '{$item.SKU}', {* SKU/code - required *}

                        '{$item.Product}', {* product name *}

                        '{$item.Category}', {* category or variation *}

                        '{$item.Price}', {* unit price - required *}

                        '{$item.Quantity}' {* quantity - required *}

                    ]);

                {/foreach}

                {* submits transaction to the Analytics servers *}

            {literal}

              _gaq.push(['_trackTrans']);    

            {/literal}

        {/if}

        {literal}

            (function() {

                var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;

                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';

                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

            })();

        {/literal}

 

</script>

 

  • Like 2
Link to comment
Share on other sites

hello

 

thank you so much for posting solution

im more thank convinced that it will be helpfull for other merchants here (i've noticed that a lot of merchants have got issues with analytics module)

 

thank you once again,

whole topic marked as [solved]

 

with regards,

Milos

Link to comment
Share on other sites

hello

 

thank you so much for posting solution

im more thank convinced that it will be helpfull for other merchants here (i've noticed that a lot of merchants have got issues with analytics module)

 

thank you once again,

whole topic marked as [solved]

 

with regards,

Milos

Well eventually it was not a big deal, i just didnt want to mess up with the .tpl file but it seems that i had to do it.

At least it works like this ok. The error i believe is something really very simple so if someone from prestashop would look on it, they could resolve it in a matter of minutes (i am not an expert).

Link to comment
Share on other sites

  • 2 weeks later...
×
×
  • Create New...