> 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/documentation/documentation-nl/integraties-websites/aangepast/backend-webhooks-toevoegen.md).

# Backend-webhooks toevoegen

Leer hoe je aangepaste webhooks instelt

### Voordat je begint

Dit artikel gaat verder waar [Aangepaste gebruikersgegevens](https://docs.adpage.io/documentation/documentation-nl/integraties-websites/aangepast/gebruikersdatascript-toevoegen.md) en [aangepaste datalayer](https://docs.adpage.io/documentation/documentation-nl/integraties-websites/aangepast/datalayer-gebeurtenissen-toevoegen.md) ophoudt. Zorg ervoor dat alle stappen in het [AdPage-container instellen](https://docs.adpage.io/documentation/documentation-nl/aan-de-slag/adpage-container-instellen.md) artikel zijn gevolgd. Dat betekent dat:

* [ ] Je **AdPage-container** is aangemaakt.
* [ ] Je AdPage-container is **verbonden met je GTM-servercontainer**.
* [ ] De **CNAME-record** is toegevoegd in je DNS-instellingen, zodat tagging draait op je eigen (sub)domein.
* [ ] De aangepaste [scripts voor gebruikersgegevens ](https://docs.adpage.io/integrations-websites/custom/add-the-custom-user-data-script-to-your-website) zijn correct op je site ingesteld.
* [ ] De [eCommerce-datalayer](https://docs.adpage.io/integrations-websites/custom/custom-ecommerce-datalayer-and-backend-webhooks-setup) staat correct op je site.

### Webhooks installeren

Backend [webhooks](https://www.adpage.io/post/webhooks) zorgen voor nauwkeurigere metingen. In eCommerce verstuur je een webhook wanneer een bestelling wordt aangemaakt. Dit is de primaire conversie.

Webhooks vereisen extra configuratie op de website. Test de implementatie grondig.

Stuur webhooks naar de geconfigureerde servercontainer-URL, bijvoorbeeld:\
`https://tagging.domain-name.com/order_created`&#x20;

### De webhook-payload

Gebruik de volgende payload voor een eCommerce-website. Verstuur deze in JSON-formaat. Wijk niet af van dit voorbeeld. Wijzigingen kunnen tracking negatief beïnvloeden.

```perl
{

  "event": "trytagging_purchase",

  "ecommerce": {

    "transaction_id": "43",

    "affiliation": "",

    "value": 45.0,

    "tax": 0.0,

    "shipping": 0.0,

    "currency": "EUR",

    "coupon": "",

    "items": [

      {

        "item_name": "copy hoodiiiee",

        "item_id": "23",

        "price": 45.0,

        "quantity": 1,

        "index": 1

      }

    ]

  },

  "user_data": {

    "customer_id": 1,

    "customer_email": "jeroen@adpage.io",

    "customer_name": "Jeroen Test",

    "customer_phone": "0612345678",

    "customer_address": "Velmolenweg 54a",

    "customer_zip": "5404 LD",

    "customer_country": "NL",

    "customer_city": "Uden",

    "customer_state": "Provincie",

    "customer_country": "Nederland",

    "billing_first_name": "Jeroen",

    "billing_last_name": "Test",

    "billing_address": "Velmolenweg 54a",

    "billing_postcode": "5404 LD",

    "billing_state": "",

    "billing_city": "Uden",

    "billing_email": "jeroen@adpage.io",

    "billing_phone": "0612345678",

    "shipping_first_name": "Jeroen",

    "shipping_last_name": "Test",

    "shipping_company": "",

    "shipping_address": "Velmolenweg 54a",

    "shipping_postcode": "5404 LD",

    "shipping_country": "NL",

    "shipping_state": "",

    "shipping_city": "Uden",

    "shipping_phone": "",

    "new_customer": "true"

  },

  "marketing": {

    // Front-end marketinggegevens en het volgende veld:

    "ip": "visitor_ip_address"

  }

}
```

### Het marketingobject

Het marketingobject komt uit het trackingscript aan de front-end. Verstuur dit gegevensobject in de backend-webhookpayload. Zie [aangepast script voor gebruikersgegevens toevoegen aan de site](https://docs.adpage.io/documentation/documentation-nl/integraties-websites/aangepast/gebruikersdatascript-toevoegen.md).

{% hint style="info" %}
De volgende functie is slechts een voorbeeld. Kopieer deze niet rechtstreeks.
{% endhint %}

```javascript
var marketingData = window.taggingHelpers.getMarketingObject();
var jsonString = JSON.stringify(marketingData);
var base64Data = base64Encode(jsonString);
   
setCookie('trytagging_user_data', base64Data, 30);
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.adpage.io/documentation/documentation-nl/integraties-websites/aangepast/backend-webhooks-toevoegen.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
