# Analytics Bestellung tracken funtioniert nicht

**URL:** <https://forum.shopware.com/t/analytics-bestellung-tracken-funtioniert-nicht/70150>\
**Category:** Allgemein\
**Created:** [11. Oktober 2020 um 08:37 UTC](https://forum.shopware.com/t/analytics-bestellung-tracken-funtioniert-nicht/70150 "2020-10-11T08:37:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ADA](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@ADA](https://forum.shopware.com/u/ADA)\
**Post date:** [11. Oktober 2020 um 08:37 UTC](https://forum.shopware.com/t/analytics-bestellung-tracken-funtioniert-nicht/70150/1 "2020-10-11T08:37:59Z")

</div>

Hallo,

bei mir wird das „purchase“ Event nicht in Google Analytics dargestellt.

Deshalb habe ich meinen eigenen Code auf der Checkout seite eingebaut.

Leider funktioniert dieser nicht immer… jemand Erfahrung? danke!!!

```
            setTimeout(function(){
                gtag("event", "purchase", {
                        transaction_id: '{{ page.order.id }}',
                        "value": {{page.order.price.totalPrice}},
                        "currency": "EUR",
                        "shipping": {{ page.order.shippingTotal }},
                        "tax": {{page.order.price.totalPrice - page.order.price.netPrice}},
                        items: [
                            {% for lineitem in page.order.lineItems.elements %}
                            {% if lineitem.type == 'product' %}
                            {
                                "id": "{{ lineitem.productId }}",
                                "name": "{{ lineitem.label }}",
                                "quantity": {{ lineitem.quantity }},
                                "list_position": {{ loop.index }},
                                "price": '{{ lineitem.unitPrice }}'
                                {% if loop.last %}
                            }
                        {% else %}
                    },
                    {% endif %}
                    {% endif %}
                    {% endfor %}
                ]
                });
            }, 1100);

```

&nbsp;
