• Priority: Medium
  • Status: Waiting on customer
  • Theme: Alysum
  • Assigned To: Fred
  • Private: No
  • Open Date: 17.08.21, 01:02
  • Opened by: Gianni Ciolfi

Ticket #22114 - AMP and Analytics

Hi, Analytics dona tracking access from. mobile

Comments

Gianni Ciolfi 17 Aug 2021, 16:29

I have insert this code in _partial file, but nothing, dont tracking from mobile

{literal}
  <script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
<amp-analytics type="gtag" data-credentials="include">
<script type="application/json">
{
  "vars" : {
    "gtag_id": "<UA-187089773-1>",
    "config" : {
      "<UA-187089773-1>": { "groups": "default" }
    }
  }
}
</script>
</amp-analytics>
{/literal}
Fred 17 Aug 2021, 16:51

Hi, Gianni.
You don't need to add code manually. We already added that code. You just need to put your analytics ID to the AMP module settings

Gianni Ciolfi 17 Aug 2021, 18:06

I had done as you say, then it didn't work and I added the code as the guide says. It doesn't work that way either. Now I have removed the code from the head.tpl file and it doesn't work.

Fred 17 Aug 2021, 18:57

Did you configure your google account like described here - https://take.ms/VseFt ?

Gianni Ciolfi 17 Aug 2021, 18:57

I had done as you say, then it didn't work and I added the code as the guide says. It doesn't work that way either. Now I have removed the code from the head.tpl file and it doesn't work.

Gianni Ciolfi 17 Aug 2021, 18:59

The suggestions say to put the code in the head.tpl file that I had inserted (but which did not work) and that you told me to remove because there is no need to add code

Fred 17 Aug 2021, 23:02

"The suggestions say to put the code..." - that's for a developer. We already add all necessary code described in the tutorial.
The question is only about configuration in your google account. Please also check out this link https://support.google.com/analytics/answer/6343176

Gianni Ciolfi 18 Aug 2021, 00:12

Earlier you told me to follow the instructions, and the instructions say to enter the code. I entered it (it doesn't work) and removed it. The code is not there but the tracking from mobile does not work. What can I do?

Fred 19 Aug 2021, 12:43

I have found out syntax error in the analytics config and fixed it
Updated file is /bacipiccanti.shop/public_html/themes/alysum/templates/mobile/_partials/footer-bottom.tpl
Please test it out now

Gianni Ciolfi 19 Aug 2021, 13:38

It now tracks data from mobile, but only the homepage and product pages, it does not track accesses to category and subcategory pages. However, it has stopped tracking data from the desktop.

Fred 19 Aug 2021, 14:11

Yes, we added only basic parameters. You can add any other parameter you need according to the documentation https://developers.google.com/analytics/devguides/collection/amp-analytics

Gianni Ciolfi 19 Aug 2021, 15:08

But I have never needed to modify anything. It used to track all the pages. I don't know where to modify the code

Fred 19 Aug 2021, 21:05

Sorry, One more fix is added into the same file. Now it should work

Gianni Ciolfi 19 Aug 2021, 23:31

Hi, the theme reports these 3 problems that slow down the navigation so much

" 2021-08-18 17:20:17 UTC [nginx][error] 6382#0: *10126356 directory index of "/home/u7-q1mibbo8ldgt/www/bacipiccanti.shop/public_html/.well-known/" is forbidden, client: 195.154.56.206, server: bacipiccanti.shop, request: "GET /.well-known/ HTTP/1.1", host: "bacipiccanti.shop", referrer: "binance.com" ‮ 2021-08-18 06:01:06 UTC [nginx][error] 62382#0: *9889156 openat() "/home/u7-q1mibbo8ldgt/www/bacipiccanti.shop/public_html/.well-known/apple-app-site-association" failed (2: No such file or directory), client: 66.249.87.123, server: bacipiccanti.shop, request: "GET /.well-known/apple-app-site-association HTTP/1.1", host: "bacipiccanti.shop" e 2021-08-17 09:36:01 UTC [apache][autoindex:error] [pid 70609] [client 207.46.13.155:12136] AH01276: Cannot serve directory /home/customer/www/bacipiccanti.shop/public_html/themes/alysum/: No matching DirectoryIndex (index.html,Index.html,index.shtml,index.php,Index.php,index.phtml,Index.phtml,index.htm,Index.htm,home.htm,Home.htm,Default.htm,Default.html,default.htm,default.html) found, and server-generated directory index forbidden by Options directive

Fred 19 Aug 2021, 23:32

I'm sorry, but how that's related to the theme?

Gianni Ciolfi 20 Aug 2021, 02:08

Hi, the theme reports these 3 problems that slow down the navigation so much

" 2021-08-18 17:20:17 UTC [nginx][error] 6382#0: *10126356 directory index of "/home/u7-q1mibbo8ldgt/www/bacipiccanti.shop/public_html/.well-known/" is forbidden, client: 195.154.56.206, server: bacipiccanti.shop, request: "GET /.well-known/ HTTP/1.1", host: "bacipiccanti.shop", referrer: "binance.com" ‮ 2021-08-18 06:01:06 UTC [nginx][error] 62382#0: *9889156 openat() "/home/u7-q1mibbo8ldgt/www/bacipiccanti.shop/public_html/.well-known/apple-app-site-association" failed (2: No such file or directory), client: 66.249.87.123, server: bacipiccanti.shop, request: "GET /.well-known/apple-app-site-association HTTP/1.1", host: "bacipiccanti.shop" e 2021-08-17 09:36:01 UTC [apache][autoindex:error] [pid 70609] [client 207.46.13.155:12136] AH01276: Cannot serve directory /home/customer/www/bacipiccanti.shop/public_html/themes/alysum/: No matching DirectoryIndex (index.html,Index.html,index.shtml,index.php,Index.php,index.phtml,Index.phtml,index.htm,Index.htm,home.htm,Home.htm,Default.htm,Default.html,default.htm,default.html) found, and server-generated directory index forbidden by Options directive

Gianni Ciolfi 20 Aug 2021, 02:10

I don't know, I don't know about code, but the hosting technicians found these 3 errors in the theme code. This is slowing down the site a lot. Can you solve it?

Gianni Ciolfi 20 Aug 2021, 09:40

I don't know, I don't know about code, but the hosting technicians found these 3 errors in the theme code. This is slowing down the site a lot. Can you solve it?

Fred 20 Aug 2021, 09:47

But that is not themes issue. There is no any mention of theme’s file in the error message

Gianni Ciolfi 20 Aug 2021, 10:47

OK, I'll talk to a developer about that.
Going back to analytics for mobile, it still doesn't track traffic from category and subcategory pages.

Fred 20 Aug 2021, 12:04

just added one more syntax fix. Now category pages seem to be tracking - https://take.ms/lgEry

Gianni Ciolfi 20 Aug 2021, 12:10

Ok, thank You.

Gianni Ciolfi 20 Aug 2021, 12:10

can I also ask you if you can understand why the site is so slow? Some developers have told me that it depends on the theme. But the site is so slow!

Fred 20 Aug 2021, 12:10

You are welcome!

Fred 20 Aug 2021, 12:12

Please make sure you have configured website performance as prestashop recommends it to do https://alysum5.promokit.eu/promokit/documentation/#performance

Our demo is pretty fast without any poster cache module, just default server and prestashop configuration

Gianni Ciolfi 20 Aug 2021, 12:19

OK, I'll talk to a developer about that.
Going back to analytics for mobile, it still doesn't track traffic from category and subcategory pages.

Gianni Ciolfi 20 Aug 2021, 12:22

Yes, Prestashop it's configured as your link, and I don't have any module for cache

Fred 20 Aug 2021, 12:23

- Review and uninstall every module you are not going to use, that's important.
- make sure Opcache is enabled in your php configuration

Gianni Ciolfi 20 Aug 2021, 12:28

Opcache is active.

Fred 20 Aug 2021, 12:38

The theme is optimised as much as possible and show good points in google page speed test

Gianni Ciolfi 20 Aug 2021, 12:51

Can you help me understand why mine is running so slow?

Fred 21 Aug 2021, 14:27

I'm not sure it's possible. Here is great tutorial how to optimise your website https://devdocs.prestashop.com/1.7/scale/optimizations/