# analytics.google wo könnte mein Fehler sein?

**URL:** https://forum.shopware.com/t/analytics-google-wo-konnte-mein-fehler-sein/69917
**Category:** Allgemein
**Created:** [29. September 2020 um 13:49 UTC](https://forum.shopware.com/t/analytics-google-wo-konnte-mein-fehler-sein/69917 "2020-09-29T13:49:16Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![AMSPO24online](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/amspo24online/32/7865_2.png) [@AMSPO24online](https://forum.shopware.com/u/AMSPO24online)
#### Post date: [29. September 2020 um 13:49 UTC](https://forum.shopware.com/t/analytics-google-wo-konnte-mein-fehler-sein/69917/1 "2020-09-29T13:49:16Z")

</div>

**Hallo,**

ich habe **analytics** eingerichtet. Mir fehlen&nbsp; irgendwo nocht Einstellungsdaten und weiß nicht wo das sein kann.

Was mus hier wo eingetragen werden?

&nbsp;

**Tracking-Code des allgemeinen Website-Tags (gtag.js):**

**gtag(‚set‘, {‚user\_id‘: ‚USER\_ID‘}); // Legen Sie die User ID mithilfe des Parameters „user\_id“ des angemeldeten Nutzers fest.**

&nbsp;

&nbsp;

**Tracking-Code für Universal Analytics (analytics.js):**

**ga(‚set‘, ‚userId‘, ‚USER\_ID‘); // Legen Sie die User ID mithilfe des Parameters „user\_id“ des angemeldeten Nutzers fest.**

&nbsp;

**MfG Rainer**

---

<div class="post-metadata">

### Author: ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)
#### Post date: [29. September 2020 um 14:03 UTC](https://forum.shopware.com/t/analytics-google-wo-konnte-mein-fehler-sein/69917/2 "2020-09-29T14:03:18Z")

</div>

die USER\_ID fängt mit “UA-”(universal analytics)&nbsp;oder “GTM-” (google tag manager) an.

Wenn du kein Plugin nutzt. musst du das im Theme manuell eintragen.

---

<div class="post-metadata">

### Author: ![AMSPO24online](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/amspo24online/32/7865_2.png) [@AMSPO24online](https://forum.shopware.com/u/AMSPO24online)
#### Post date: [29. September 2020 um 14:22 UTC](https://forum.shopware.com/t/analytics-google-wo-konnte-mein-fehler-sein/69917/3 "2020-09-29T14:22:40Z")

</div>

**Danke für die Hilfe.**

**Im Shop:**

 ![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/2X/0/08fefcf01da4bc2873ce237250f51334fea5b9cc.png)

**in Google Analytics sieht es so aus:**

 ![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/2X/2/277b957e90ab5a59d46739d8d7ba0917737901a6.png)

&nbsp;

**Unter**

**sieht es so aus. Wobei sich die User-Id nicht ansteuern lässt.**

Ich mache irgendwas falsch.

---

<div class="post-metadata">

### Author: ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)
#### Post date: [29. September 2020 um 14:39 UTC](https://forum.shopware.com/t/analytics-google-wo-konnte-mein-fehler-sein/69917/4 "2020-09-29T14:39:42Z")

</div>

Ah ok. Das ist nicht diese ID.

Was hier eingetrage wird ist die Tracking-ID . Klick mal bei Google&nbsp;auf Tracking-Information -\> Tracking-Code.

Da steht dann deine ID und diese musst du im Shop eintragen.

---

<div class="post-metadata">

### Author: ![AMSPO24online](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/amspo24online/32/7865_2.png) [@AMSPO24online](https://forum.shopware.com/u/AMSPO24online)
#### Post date: [29. September 2020 um 14:48 UTC](https://forum.shopware.com/t/analytics-google-wo-konnte-mein-fehler-sein/69917/5 "2020-09-29T14:48:31Z")

</div>

Ja, die habe ich drin.

Google Analytics bringt denoch keine Daten.

---

<div class="post-metadata">

### Author: ![Moritz\_Naczenski](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/moritz_naczenski/32/7792_2.png) [@Moritz\_Naczenski](https://forum.shopware.com/u/Moritz_Naczenski)
#### Post date: [29. September 2020 um 15:39 UTC](https://forum.shopware.com/t/analytics-google-wo-konnte-mein-fehler-sein/69917/6 "2020-09-29T15:39:28Z")

</div>

> [@AMSPO24online schrieb:](https://forum.shopware.com/profile/34281/AMSPO24online "AMSPO24online")
> 
> Ja, die habe ich drin.
> 
> Google Analytics bringt denoch keine Daten.

Cookies denn akzeptiert?

&nbsp;

---

<div class="post-metadata">

### Author: ![AMSPO24online](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/amspo24online/32/7865_2.png) [@AMSPO24online](https://forum.shopware.com/u/AMSPO24online)
#### Post date: [29. September 2020 um 15:49 UTC](https://forum.shopware.com/t/analytics-google-wo-konnte-mein-fehler-sein/69917/7 "2020-09-29T15:49:32Z")

</div>

Alle Cookies im Shop akzeptiert&nbsp; &nbsp;ja

jetzt egal, ich hatte nebenbei Matomo installiert. Das funktioniert wenigstens.

&nbsp;

analytics.google versuche ich schon einige Tage einzurichten, ohne erfolg.

Vielen Dank.

---

<div class="post-metadata">

### Author: ![AMSPO24online](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/amspo24online/32/7865_2.png) [@AMSPO24online](https://forum.shopware.com/u/AMSPO24online)
#### Post date: [8. April 2021 um 08:50 UTC](https://forum.shopware.com/t/analytics-google-wo-konnte-mein-fehler-sein/69917/8 "2021-04-08T08:50:01Z")

</div>

Ich habe alles versucht, den Shop mit Analytics zum laufen zu bringen.

Cache gelöscht und die Tracking-ID eingetragen. Die Datenschutzerklärung akzeptiert.

Da tut sich nichts.

Shopware 6 → Google Analytics-Integration Tracking-ID: UA-19XXX22XX-1 eingetragen → Analytics mit gleicher Tracking-ID: UA-19XXX22XX-1 eingetragen. Alle Zustimmungen gemacht.

Nutze: universal analytics

Gruß Rainer

---

<div class="post-metadata">

### Author: ![markssar](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@markssar](https://forum.shopware.com/u/markssar)
#### Post date: [12. April 2021 um 18:22 UTC](https://forum.shopware.com/t/analytics-google-wo-konnte-mein-fehler-sein/69917/9 "2021-04-12T18:22:20Z")

</div>

Hi Rainer,  
Change script block in analytics.html.twig file to google analytics website tracking code. The Google analytics code starts running immediately. This is a Shopware 6 google analytics error, I also experimented for several days while just changing the tracking code in a twig file.

---

<div class="post-metadata">

### Author: ![AMSPO24online](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/amspo24online/32/7865_2.png) [@AMSPO24online](https://forum.shopware.com/u/AMSPO24online)
#### Post date: [25. April 2021 um 09:32 UTC](https://forum.shopware.com/t/analytics-google-wo-konnte-mein-fehler-sein/69917/10 "2021-04-25T09:32:09Z")

</div>

> [@markssar](#):
>
> Change script block in analytics.html.twig file to google analytics website tracking code.

Hi markssar,

Many Thanks - where can I find the script block exactly?

I don’t know enough about that. Need detailed information!

Sincerely  
Rainer

---

<div class="post-metadata">

### Author: ![markssar](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@markssar](https://forum.shopware.com/u/markssar)
#### Post date: [25. April 2021 um 10:01 UTC](https://forum.shopware.com/t/analytics-google-wo-konnte-mein-fehler-sein/69917/11 "2021-04-25T10:01:03Z")

</div>

Hi Rainer - file path is YourShopFolder-vendor-shopware-storefront-Resources-views-storefront-component-analytics.html.twig. It looks like this. This of course may not be right to fix the system, but it works! Insert Yours UA tracking numbers!

{% block component\_head\_analytics %}  
{% if context.salesChannel.analytics and context.salesChannel.analytics.isActive() %}  
{% set trackingId = context.salesChannel.analytics.getTrackingId() %}  
  
  
  
window.dataLayer = window.dataLayer || ;  
function gtag(){dataLayer.push(arguments);}  
gtag(‚js‘, new Date());

```
        gtag('config', 'UA-19_Your_Tracking_UA-1');
    </script>
{% endif %}

```

{% endblock %}

---

<div class="post-metadata">

### Author: ![markssar](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@markssar](https://forum.shopware.com/u/markssar)
#### Post date: [25. April 2021 um 10:05 UTC](https://forum.shopware.com/t/analytics-google-wo-konnte-mein-fehler-sein/69917/12 "2021-04-25T10:05:21Z")

</div>

Hi Rainer, Use all your google tracking code - my example was corrupted by copying it into this chat! Just follow the principle where to insert the code block!

---

<div class="post-metadata">

### Author: ![markssar](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@markssar](https://forum.shopware.com/u/markssar)
#### Post date: [25. April 2021 um 10:35 UTC](https://forum.shopware.com/t/analytics-google-wo-konnte-mein-fehler-sein/69917/13 "2021-04-25T10:35:43Z")

</div>

![Screen Shot 2021-04-25 at 13.22.49](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/2X/3/3eaaec22ac0cdc31c84bd2ee81ea4ba94d000b05.png) wird hochgeladen: Screen Shot 2021-04-25 at 13.22.49.png…

---

<div class="post-metadata">

### Author: ![AMSPO24online](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/amspo24online/32/7865_2.png) [@AMSPO24online](https://forum.shopware.com/u/AMSPO24online)
#### Post date: [26. April 2021 um 08:48 UTC](https://forum.shopware.com/t/analytics-google-wo-konnte-mein-fehler-sein/69917/14 "2021-04-26T08:48:01Z")

</div>

Good Morning,

thank you for the detailed information. I don’t know what is blocking. I will continue to use Matomo.

I had the Gambio software before and it worked.  
Thanks again for your help.

With best regards  
Rainer
