[Skip to main content](#vessel-content)

#   Google Analytics conflict

##

- **[sambob](/forum/user/7887-sambob "View sambob's Profile")**
- [![sambob's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7887.png)](/forum/user/7887-sambob "View sambob's Profile") Topic Author
- [ Offline](/forum/user/7887-sambob)

Less More

- Posts: 260
- Thank you received: 25
-
- [](https://viemedia.com.au)
-

13 years 5 months ago [\#105833](#105833) by [sambob](/forum/user/7887-sambob "View sambob's Profile")  *[Google Analytics conflict](/forum/4-how-to/82698-google-analytics-conflict#105833 "Hi,  I am have some issues with inconsistent Google Analytics recoding of transactions. Soe are missed and some have the totals doubling.  After about 4 weeks pushing Google on it, they have analysed what they perceive as the issue.  1) I am using the Hikashop plugin as well as the GA code added to the template, and this is creating code duplication where the plugin is adding the code.  Any thoughts on how to stop the general site code from plugin one?  2) There is another error as there is a comma behind the last Tran parameter country:  'Australia', // country  but it should look like this: 'Australia' // country  Ant thoughts on solving these.")* was created by *[sambob](/forum/user/7887-sambob "View sambob's Profile")*

Hi,

I am have some issues with inconsistent Google Analytics recoding of transactions. Soe are missed and some have the totals doubling.

After about 4 weeks pushing Google on it, they have analysed what they perceive as the issue.

1) I am using the Hikashop plugin as well as the GA code added to the template, and this is creating code duplication where the plugin is adding the code.

Any thoughts on how to stop the general site code from plugin one?

2) There is another error as there is a comma behind the last Tran parameter country:

'Australia', // country

but it should look like this:
'Australia' // country

*This attachment is hidden for guests.
Please log in or register to see it.*

Ant thoughts on solving these.

---

Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzgyNjk4LWdvb2dsZS1hbmFseXRpY3MtY29uZmxpY3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14279
-
-

13 years 5 months ago [\#105948](#105948) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Google Analytics conflict](/forum/4-how-to/82698-google-analytics-conflict#105948 "Hi,  I am have some issues with inconsistent Google Analytics recoding of transactions. Soe are missed and some have the totals doubling.  After about 4 weeks pushing Google on it, they have analysed what they perceive as the issue.  1) I am using the Hikashop plugin as well as the GA code added to the template, and this is creating code duplication where the plugin is adding the code.  Any thoughts on how to stop the general site code from plugin one?  2) There is another error as there is a comma behind the last Tran parameter country:  'Australia', // country  but it should look like this: 'Australia' // country  Ant thoughts on solving these.")*

Hi,

For the country it's easy, just change the line: Code:

'".str_replace("'",'\\\'',@$order-&gt;billing_address-&gt;address_country)."', // country

to: Code:

'".str_replace("'",'\\\'',@$order-&gt;billing_address-&gt;address_country)."' // country

in the file plugins/system/hikashopanalytics.php

For the GA code in the template, what is the exact code that you added in your template ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzgyNjk4LWdvb2dsZS1hbmFseXRpY3MtY29uZmxpY3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[sambob](/forum/user/7887-sambob "View sambob's Profile")**
- [![sambob's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7887.png)](/forum/user/7887-sambob "View sambob's Profile") Topic Author
- [ Offline](/forum/user/7887-sambob)

Less More

- Posts: 260
- Thank you received: 25
-
- [](https://viemedia.com.au)
-

13 years 5 months ago [\#106011](#106011) by [sambob](/forum/user/7887-sambob "View sambob's Profile")  Replied by *[sambob](/forum/user/7887-sambob "View sambob's Profile")* on topic *[Google Analytics conflict](/forum/4-how-to/82698-google-analytics-conflict#106011 "Hi,  I am have some issues with inconsistent Google Analytics recoding of transactions. Soe are missed and some have the totals doubling.  After about 4 weeks pushing Google on it, they have analysed what they perceive as the issue.  1) I am using the Hikashop plugin as well as the GA code added to the template, and this is creating code duplication where the plugin is adding the code.  Any thoughts on how to stop the general site code from plugin one?  2) There is another error as there is a comma behind the last Tran parameter country:  'Australia', // country  but it should look like this: 'Australia' // country  Ant thoughts on solving these.")*

Hi Nicolas,

thanks you your reply.

The code I have (template.php) is:
&lt;script type="text/javascript"&gt;

var _gaq = _gaq &#124;&#124; [];
_gaq.push();
_gaq.push();

(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);
})();

&lt;/script&gt;

---

Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzgyNjk4LWdvb2dsZS1hbmFseXRpY3MtY29uZmxpY3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14279
-
-

13 years 5 months ago [\#106086](#106086) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Google Analytics conflict](/forum/4-how-to/82698-google-analytics-conflict#106086 "Hi,  I am have some issues with inconsistent Google Analytics recoding of transactions. Soe are missed and some have the totals doubling.  After about 4 weeks pushing Google on it, they have analysed what they perceive as the issue.  1) I am using the Hikashop plugin as well as the GA code added to the template, and this is creating code duplication where the plugin is adding the code.  Any thoughts on how to stop the general site code from plugin one?  2) There is another error as there is a comma behind the last Tran parameter country:  'Australia', // country  but it should look like this: 'Australia' // country  Ant thoughts on solving these.")*

Hi,

Add the line: Code:

$body = preg_replace("#&lt;script type=\"text/javascript\"&gt;.*'https://ssl' : 'http://www') + '\.google-analytics.com.*&lt;/script&gt;#siU",'',$body);

before: Code:

$body=str_replace('&lt;/head&gt;', $js.'&lt;/head&gt;', $body);

in the file plugins/system/hikashopanalytics.php and that should remove the code duplication.

The following user(s) said Thank You: [sambob](/forum/user/7887-sambob "View sambob's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzgyNjk4LWdvb2dsZS1hbmFseXRpY3MtY29uZmxpY3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[sambob](/forum/user/7887-sambob "View sambob's Profile")**
- [![sambob's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7887.png)](/forum/user/7887-sambob "View sambob's Profile") Topic Author
- [ Offline](/forum/user/7887-sambob)

Less More

- Posts: 260
- Thank you received: 25
-
- [](https://viemedia.com.au)
-

13 years 5 months ago [\#106155](#106155) by [sambob](/forum/user/7887-sambob "View sambob's Profile")  Replied by *[sambob](/forum/user/7887-sambob "View sambob's Profile")* on topic *[Google Analytics conflict](/forum/4-how-to/82698-google-analytics-conflict#106155 "Hi,  I am have some issues with inconsistent Google Analytics recoding of transactions. Soe are missed and some have the totals doubling.  After about 4 weeks pushing Google on it, they have analysed what they perceive as the issue.  1) I am using the Hikashop plugin as well as the GA code added to the template, and this is creating code duplication where the plugin is adding the code.  Any thoughts on how to stop the general site code from plugin one?  2) There is another error as there is a comma behind the last Tran parameter country:  'Australia', // country  but it should look like this: 'Australia' // country  Ant thoughts on solving these.")*

Thanks nicolas,

Greatly appreciated.

---

Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzgyNjk4LWdvb2dsZS1hbmFseXRpY3MtY29uZmxpY3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[sambob](/forum/user/7887-sambob "View sambob's Profile")**
- [![sambob's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7887.png)](/forum/user/7887-sambob "View sambob's Profile") Topic Author
- [ Offline](/forum/user/7887-sambob)

Less More

- Posts: 260
- Thank you received: 25
-
- [](https://viemedia.com.au)
-

13 years 5 months ago [\#106248](#106248) by [sambob](/forum/user/7887-sambob "View sambob's Profile")  Replied by *[sambob](/forum/user/7887-sambob "View sambob's Profile")* on topic *[Google Analytics conflict](/forum/4-how-to/82698-google-analytics-conflict#106248 "Hi,  I am have some issues with inconsistent Google Analytics recoding of transactions. Soe are missed and some have the totals doubling.  After about 4 weeks pushing Google on it, they have analysed what they perceive as the issue.  1) I am using the Hikashop plugin as well as the GA code added to the template, and this is creating code duplication where the plugin is adding the code.  Any thoughts on how to stop the general site code from plugin one?  2) There is another error as there is a comma behind the last Tran parameter country:  'Australia', // country  but it should look like this: 'Australia' // country  Ant thoughts on solving these.")*

Hi Nicholas,

No, that stopped the recording of the campaigns - so no CPC info received since make the change.

---

Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzgyNjk4LWdvb2dsZS1hbmFseXRpY3MtY29uZmxpY3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14279
-
-

13 years 5 months ago [\#106285](#106285) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Google Analytics conflict](/forum/4-how-to/82698-google-analytics-conflict#106285 "Hi,  I am have some issues with inconsistent Google Analytics recoding of transactions. Soe are missed and some have the totals doubling.  After about 4 weeks pushing Google on it, they have analysed what they perceive as the issue.  1) I am using the Hikashop plugin as well as the GA code added to the template, and this is creating code duplication where the plugin is adding the code.  Any thoughts on how to stop the general site code from plugin one?  2) There is another error as there is a comma behind the last Tran parameter country:  'Australia', // country  but it should look like this: 'Australia' // country  Ant thoughts on solving these.")*

What is the HTML of the page once you confirm the order ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzgyNjk4LWdvb2dsZS1hbmFseXRpY3MtY29uZmxpY3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[sambob](/forum/user/7887-sambob "View sambob's Profile")**
- [![sambob's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7887.png)](/forum/user/7887-sambob "View sambob's Profile") Topic Author
- [ Offline](/forum/user/7887-sambob)

Less More

- Posts: 260
- Thank you received: 25
-
- [](https://viemedia.com.au)
-

13 years 5 months ago -  13 years 5 months ago [\#106406](#106406) by [sambob](/forum/user/7887-sambob "View sambob's Profile")  Replied by *[sambob](/forum/user/7887-sambob "View sambob's Profile")* on topic *[Google Analytics conflict](/forum/4-how-to/82698-google-analytics-conflict#106406 "Hi,  I am have some issues with inconsistent Google Analytics recoding of transactions. Soe are missed and some have the totals doubling.  After about 4 weeks pushing Google on it, they have analysed what they perceive as the issue.  1) I am using the Hikashop plugin as well as the GA code added to the template, and this is creating code duplication where the plugin is adding the code.  Any thoughts on how to stop the general site code from plugin one?  2) There is another error as there is a comma behind the last Tran parameter country:  'Australia', // country  but it should look like this: 'Australia' // country  Ant thoughts on solving these.")*

Hi Nicholas, I appreciate your effort.

Attached is the html the thankyou page

*This attachment is hidden for guests.
Please log in or register to see it.*

---

Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Last edit: 13 years 5 months ago by [sambob](/forum/user/7887-sambob "View sambob's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzgyNjk4LWdvb2dsZS1hbmFseXRpY3MtY29uZmxpY3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14279
-
-

13 years 5 months ago [\#106508](#106508) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Google Analytics conflict](/forum/4-how-to/82698-google-analytics-conflict#106508 "Hi,  I am have some issues with inconsistent Google Analytics recoding of transactions. Soe are missed and some have the totals doubling.  After about 4 weeks pushing Google on it, they have analysed what they perceive as the issue.  1) I am using the Hikashop plugin as well as the GA code added to the template, and this is creating code duplication where the plugin is adding the code.  Any thoughts on how to stop the general site code from plugin one?  2) There is another error as there is a comma behind the last Tran parameter country:  'Australia', // country  but it should look like this: 'Australia' // country  Ant thoughts on solving these.")*

Hi,

I don't see why it would stop the recording of sales since actually the regex was wrong and the line I gave you was actually not doing anything.

Instead of the line: Code:

$body = preg_replace("#&lt;script type=\"text/javascript\"&gt;.*'https://ssl' : 'http://www') + '\.google-analytics.com.*&lt;/script&gt;#siU",'',$body);

add the line: Code:

$body = preg_replace("#&lt;script type=\"text/javascript\"&gt;.*'https://ssl' : 'http://www'\) \+ '\.google-analytics\.com.*&lt;/script&gt;#siU",'',$body);

and that should properly remove the normal GA javascript from the template.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzgyNjk4LWdvb2dsZS1hbmFseXRpY3MtY29uZmxpY3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[sambob](/forum/user/7887-sambob "View sambob's Profile")**
- [![sambob's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7887.png)](/forum/user/7887-sambob "View sambob's Profile") Topic Author
- [ Offline](/forum/user/7887-sambob)

Less More

- Posts: 260
- Thank you received: 25
-
- [](https://viemedia.com.au)
-

13 years 5 months ago [\#106580](#106580) by [sambob](/forum/user/7887-sambob "View sambob's Profile")  Replied by *[sambob](/forum/user/7887-sambob "View sambob's Profile")* on topic *[Google Analytics conflict](/forum/4-how-to/82698-google-analytics-conflict#106580 "Hi,  I am have some issues with inconsistent Google Analytics recoding of transactions. Soe are missed and some have the totals doubling.  After about 4 weeks pushing Google on it, they have analysed what they perceive as the issue.  1) I am using the Hikashop plugin as well as the GA code added to the template, and this is creating code duplication where the plugin is adding the code.  Any thoughts on how to stop the general site code from plugin one?  2) There is another error as there is a comma behind the last Tran parameter country:  'Australia', // country  but it should look like this: 'Australia' // country  Ant thoughts on solving these.")*

Hi Nicolas,

firstly let me say your product support is the best around; it is greatly appreciated.

Its got me baffled too. I will give you suggestion a try tonight (AU time) ad report back.

Thanks again.

---

Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzgyNjk4LWdvb2dsZS1hbmFseXRpY3MtY29uZmxpY3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[sambob](/forum/user/7887-sambob "View sambob's Profile")**
- [![sambob's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7887.png)](/forum/user/7887-sambob "View sambob's Profile") Topic Author
- [ Offline](/forum/user/7887-sambob)

Less More

- Posts: 260
- Thank you received: 25
-
- [](https://viemedia.com.au)
-

13 years 2 months ago [\#120483](#120483) by [sambob](/forum/user/7887-sambob "View sambob's Profile")  Replied by *[sambob](/forum/user/7887-sambob "View sambob's Profile")* on topic *[Google Analytics conflict](/forum/4-how-to/82698-google-analytics-conflict#120483 "Hi,  I am have some issues with inconsistent Google Analytics recoding of transactions. Soe are missed and some have the totals doubling.  After about 4 weeks pushing Google on it, they have analysed what they perceive as the issue.  1) I am using the Hikashop plugin as well as the GA code added to the template, and this is creating code duplication where the plugin is adding the code.  Any thoughts on how to stop the general site code from plugin one?  2) There is another error as there is a comma behind the last Tran parameter country:  'Australia', // country  but it should look like this: 'Australia' // country  Ant thoughts on solving these.")*

Ok.. all good now.

Recording as expected.

Appreciate it!

---

Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzgyNjk4LWdvb2dsZS1hbmFseXRpY3MtY29uZmxpY3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.092 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
