The quickest way is an extension from the Shopware Store that adds the Google tag or the Google Tag Manager (GTM) to your shop. A Google tag is a single code snippet that is added to a website to collect specific data and send it to Google services.
With the Google Tag Manager, such tags as well as other marketing and analytics tags (e.g. Google Analytics, AdWords) can be managed and implemented centrally and flexibly, without direct changes to the code of the website.
You can use a Google tag on its own or together with the Google Tag Manager. You will find more information directly at Google:
To add the Google Tag Manager to your Shopware shop as quickly and easily as possible, we recommend a suitable extension from the Shopware Store:
Adding the Google tag manually
We currently have no tutorial for adding the Google tag manually. As user data is collected and processed when using Google tags and the Google Tag Manager, compliant use under the General Data Protection Regulation (GDPR) must be considered. We recommend asking your data protection officer for their assessment beforehand.
From a technical point of view, the block "layout_head_javascript_tracking" in meta.html.twig seems to be a suitable place.
In the theme configuration, the block "Expert settings" (tab "Others") offers the fields "Individual HTML code" for the head area and "Individual JavaScript code" for the end of the page. Please note that Shopware might clean code from text fields in the future.