> For the complete documentation index, see [llms.txt](https://docs.adpage.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.adpage.io/integrations-websites/shopware.md).

# Shopware

Setting up server-side tagging for a Shopware webshop

## Setting up server-side tagging for Shopware

This article walks you through the full setup of server-side tagging on a Shopware store.

### Before you start

This article picks up where **Getting Started** leaves off. Make sure all of the steps in the [Setup AdPage container](/getting-started/setup-adpage-container.md) article have been followed. Which means that:

* [ ] Your **AdPage container** is created.
* [ ] Your AdPage container is **connected to your GTM server container**.
* [ ] The **CNAME record** is added in your DNS settings, so tagging runs on your own (sub)domain.
* [ ] The **Tagging Pixel script** has been installed to ensure a connection with the GTM web container.

{% hint style="warning" %}
If one of these steps is still open, finish it first. Everything below assumes your server container is reachable on your own domain and that the AdPage dataLayer is present on the webshop's frontend.
{% endhint %}

***

### Step 1: Set up an e-commerce dataLayer

AdPage does not offer a native dataLayer plugin for Shopware, so you will need to set one up yourself. Your shop may already have a dataLayer in place. If it does not, we recommend the following plugin: [Shopware plugin settings for GA4 + remarketing](https://store.shopware.com/en/dtgs888695584742m12/google-tag-manager-ga4-remarketing.html)

Within this plugin, disable everything except enhanced ecommerce and hash enhanced conversion. The plugin can send data to GA4 and Google Ads directly, but that won't be through server-side tagging. Leaving those options enabled would result in duplicate hits. The only thing this plugin needs to do is push e-commerce events to the dataLayer, where your server-side tagging setup will picks them up.

Once installed, open your shop in the browser and confirm that the dataLayer is populated. You should see events such as `view_item`, `add_to_cart` and `purchase` appear as you move through the shop and complete a test order.

*The settings in the plugin:*

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2FZdA5IJRT9A23Fi231nU1%2Fimage.png?alt=media&amp;token=608be43b-ea76-48c8-a762-ee6e1e231584" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2F93cCnAcG9NCNwBPRkO9h%2Fimage.png?alt=media&amp;token=2fb9e702-ba35-4188-83e0-12f6a6823e05" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2FWf7QIjXGziJ3VX1EsVMk%2Fimage.png?alt=media&amp;token=49fb3291-ba0a-48c5-a602-c758898d3409" alt=""><figcaption></figcaption></figure>

***

### Step 2: Set up the AdPage webhook plugin

Set up the webhooks for the purchase event. You do this by installing the AdPage webhook plugin via Composer. The plugin is available [here](https://github.com/AdPageGroup/Shopware).

The webhook sends the order data from Shopware to your AdPage server container directly from the backend, independent of the browser. This makes the purchase event reliable even when a visitor closes the tab immediately after checkout, when the browser blocks tracking, or when consent has not been granted for client side tracking.

If you are not able to install the plugin via Composer yourself, ask your web developer or hosting party to do it for you.

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2Fd9GEKf5eHIgaijGTe9Z6%2Fimage.png?alt=media&amp;token=ffe13dbe-c4b9-4d93-a072-49426b2f8c46" alt=""><figcaption></figcaption></figure>

***

### Step 3: Set up your Sales Channel

Shopware works with a separate configuration for every sales channel. A sales channel can be its own domain, but it can also live within an existing domain. Because plugin settings are applied per sales channel, you configure the AdPage plugin separately for each one.

An example. The "domainx" sales channel covers [domainx.nl](http://domainx.nl/). Alongside it there is a second sales channel, "domainx business", that sits within the same domain and will become available at <https://www.domainx.nl/business> or <https://www.domainx.nl/workwear>. Both need their own configuration.

* Select the sales channels whose transactions you want to forward to your online marketing platforms. The tagging URL can be set per channel.
* If you add or change sales channels later on, you can adjust them in the plugin as well. Make sure the tagging URL you enter for the domain matches the tagging URL configured in your tagging platform.

That last point is the one that most often goes wrong in practice, so if you want I can expand it into a short callout explaining what breaks when the two do not match (webhooks arriving on a container that does not recognise the domain, so purchases never land in the platforms).

***

### Step 4: Set up GA4 tracking in Google Tag Manager

Server-side tagging with an AdPage server container works by receiving GA4 formatted requests from the client. Therefore you have to set up GA4 event tags on the client that send these requests towards your server container URL. And on your server container you'll need a GA4 Client and a GA4 tag in the server container make sure those requests get forwarded to your Google Analytics 4 property as GA4 events.

#### **Google Tag Manager server container steps**

1. **GA4 Client.** A Client receives incoming data on the server. The GA4 Client lets the server read data in GA4 format. It already exists by default under Clients, and needs no changes for a regular setup.
2. **GA4 tag.** Go to Tags and create a new tag with Google Analytics: GA4 as the configuration. Two fields matter most. Measurement ID decides which property the data goes to, and leaving it empty means the tag uses whichever Measurement ID your web container sends along. Event name forces one specific event name, so leave it empty to pass incoming event names through unchanged.
3. **Trigger.** Set the trigger condition to `Client Name` equals `GA4` so all incoming GA4 events are forwarded. If Client Name is not in the dropdown, add it via Choose Built-in variable.
4. **Preview URL.** Go to Admin, open Container settings and add your tracking subdomain under Server container URLs. Without this, server side preview mode will not launch.

#### **Google Tag Manager web container steps**

1. **Override the GA4 endpoint in the Google tag.** The Google tag loads the measurement library and holds the shared configuration for all your GA4 hits. Event tags carry only the event name and parameters, and inherit the rest from the Google tag with the same Measurement ID. Setting the endpoint here once means every event tag follows. Add these three parameters:
   * `server_container_url` = your AdPage server container URL
   * `send_page_view` = `false`
   * `first_party_collection` = `true`
2. **GA4 page\_view event tag.** With `send_page_view` set to `false`, the `page_view` event is no longer created automatically, which is what you want. An automatic `page_view` cannot carry extra parameters, and `event_id` in particular is needed for deduplication on the marketing platforms. Create a new Google Analytics: GA4 Event tag, fill in your Measurement ID and set the event name to `page_view`. For the trigger, use the dataLayer event your Consent Management Platform pushes on every page, or All Pages if there is none.

### **Test before publishing**

Every existing GA4 event tag with the same Measurement ID now routes through your server container as well, including purchases, form submissions and custom events. Open preview mode in both containers side by side, click through your key interactions, and confirm each request reaches your tracking domain, gets claimed by the GA4 Client and leaves for GA4 with the expected parameters. Only publish once you have seen every important event complete that path.

***

### Need help?

Still seeing missing events, duplicated conversions or unassigned traffic after following these steps? Reach out to our support team and we will take a look with you.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.adpage.io/integrations-websites/shopware.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
