Google Analytics Script

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
BrianMecler
Posts: 41
Joined: 03 Jun 2023, 17:30

Google Analytics Script

Post by BrianMecler » 04 Jun 2023, 12:45

Hello,

Would this be the ideal method/location to add the Google Analytics js script into the header of every page?

1) I generated an extension and copied the zip file for it into:
/var/www/html/packages/<my-ext-name>

2) I copied the default theme into my own theme:
cp -R /var/www/html/public/vendor/shop/themes/default /var/www/html/packages/<my-ext-name>/themes/client/html/<my-theme-name>

3) I copied the template header into my extensions folder here:
/var/www/html/packages/<my-ext-name>/templates/client/html/cms/page/header.php

4) I placed the Google Analytics tracking code into:
/var/www/html/packages/<my-ext-name>/templates/client/html/cms/page/header.php

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: Google Analytics Script

Post by aimeos » 04 Jun 2023, 17:07

Best place is in the base.blade.php which you can copy to your ./resource/views/vendor/shop/ directory:
https://github.com/aimeos/aimeos-larave ... .blade.php

See also: https://aimeos.org/docs/latest/laravel/ ... -templates
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply