• Closed by: Fred
  • Closed on: 03.01.20, 14:12
  • Reason: Closed
  • Comment: Glad to help!

Ticket #16130 - Google Analytics

Hi Marek,

We are using the Google Analytics module, and nearly all information (like visitors and real-time etc) is working well, but we get NO e-commerce data like conversion and conversion-rate, can this be related to theme? Do I have to put the script somewhere in stead of using the module?

Comments

Marek 08 Nov 2019, 12:22

Try to disable Footer Builder in the Theme Settings just for a test and let me know a result

Marianne van der Sluis 11 Nov 2019, 17:48

Hi Marek,

We disabled the footer theme builder, bought something but no result, sales still not visible no conversion in GA
The other thing strange is that it is not “listening” to out filters like: not display our IP when I visit the shop myself. It ignores that and displays me as coming from the other side of the country

Marek 11 Nov 2019, 17:50

Which domain I have to check out?

Marianne van der Sluis 11 Nov 2019, 17:51

eenhoorn.eu

Marek 11 Nov 2019, 17:56

As I can see you have injected all necessary scripts to the theme https://take.ms/JLOc3 so all should works fine. Please check out once again Google Analytics code

Marianne van der Sluis 11 Nov 2019, 18:00

Yes that’s our code

Attachments:

Schermafbeelding 2019-11-11 o... (74.3 KiB)
Marek 11 Nov 2019, 19:10

I’m not sure that is a theme’s issue. Tr to reset your Google Analytics module

Marianne van der Sluis 11 Nov 2019, 20:35

Thank you for looking into this, I will do that.

Marek 12 Nov 2019, 13:59

ok, let me know the result

Marianne van der Sluis 12 Nov 2019, 15:08

No luck after reset of module still the same

Fred 12 Nov 2019, 15:37

There is a way to figure our is that a theme’s issue or not. Try to switch to Classic theme and check out analytics. Make a backup before switching the theme

Marianne van der Sluis 12 Nov 2019, 15:52

Hi Fred,

Our site is a live-site with customers who want to buy our things, I can not switch the theme off, people will see a strange shop and not buy anything.

Can I maybe try something different, like hardcode the GA in de head.tpl?

Fred 12 Nov 2019, 15:54

Ok, try to disable analytics module and add necessary code to the head.tpl

Marianne van der Sluis 12 Nov 2019, 16:02

Do i have to add {literal} {/literal}?

Fred 12 Nov 2019, 16:03

you can skip it, just use a space after “{”

Marianne van der Sluis 12 Nov 2019, 16:06

? a space after which “{” ??

Fred 12 Nov 2019, 16:06

after every braket “{”

Marianne van der Sluis 12 Nov 2019, 16:11

Still makes no sense to me I only add code like this and don’t use brackets:
<!– Global site tag (gtag.js) - Google Analytics –>
<script async src=”https://www.googletagmanager.com/gtag/js?id=UAXXXXXXXXX“></script>
<script>

window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-XXXXX');

</script>

And use no brackets, or do I need to add them??

AND

i read in other topic answer of Marek stating to put the code in different file: layout-both-columns.tpl
does that make sense or is it irrelevant to my issue?

Marianne van der Sluis 13 Nov 2019, 11:02

I tried putting the code in the head.tpl but then it broke the site.
I don’t know where to put the code

Fred 13 Nov 2019, 11:27

Ok, try to use it with “{literal}” tags, like this

<script>
{literal}
Your code here...
{/literal}
</script>
Marianne van der Sluis 13 Nov 2019, 11:30

Where in the head.tpl do I put this!

Beginning? in a ‘block’? end?

Marianne van der Sluis 13 Nov 2019, 12:13

It did not work like that with first <script> and then {literal}
When I took away the <script></script> it started to register (and did not break the site).

But I don’t know it it wil register the ecommerce in the right way yet because the data it shows for conversion still looks strange, looks like it is tracking carts in stead of orders?

Attachments:

Schermafbeelding 2019-11-13 o... (29.4 KiB)
Marianne van der Sluis 13 Nov 2019, 12:20

Very strange, but i see now that it does have to do with the theme……… see attachement!

It shows sales today, we did not sell, it does not show what we did sell but it gives a source that looks strange to me: support.promokit.eu/refferal

That must be yours, can you look into this?

Attachments:

Schermafbeelding 2019-11-13 o... (111.8 KiB)
Fred 13 Nov 2019, 17:15

Please give me your script I’ll add it for you

Marianne van der Sluis 14 Nov 2019, 10:26

Script is in the attachement.

I have already added this script to: themes/child_alysum_eenhoorn/templates/_partials/head

So maybe you want to change that or take that away I don’t know? go ahead and please let me know what you did.

Attachments:

eenhoorn-GA-code.txt (0.3 KiB)
Fred 14 Nov 2019, 10:49

I just added it to the file /themes/child_alysum_eenhoorn/templates/_partials/head.tpl and the page is working.
I have noticed that is not Google Analytics but Google Tag Manager. Now you have enables Tag Manager module and that code what duplicate the module. Try to disable the module

All these configurations doesn’t covering by support

Marianne van der Sluis 15 Nov 2019, 11:27

Since you’ve put the code in there I have seen no changes.
In google analytics I can still see the visitors but I still don’t see the ecommerce and sales.

You say that we have a tagmanager code, but we don’t have a module called tagmanager.
This same analytics code worked well for us before.

I see that in the analytics script it says ‘tagmanager’ but i think that is how GA now gathers the analytics information, because we don’t have an tagmanager account and no module in the website called tagmanager, so I can not switch anything off.

Fred 15 Nov 2019, 12:45

Usually it works just with the module where you set your GA id and nothing more. I have no idea what what is your problem.
Try to remove all custom codes, reset your analytics modules and check how it’s working.
You can also switch to default prestashop theme to test out your analytics