# WooCommerce

### Passo 1 : Criar Oferta

Para rastreamento sem cookies, é obrigatório incluir o parâmetro click ID e token na URL da Oferta e também em todas as páginas de destino ao criar uma oferta no painel Offer18.

{% code title="Exemplo" overflow="wrap" %}

```
https://shopurl.com/?<YOUR-CLICK-ID-PARAMETER>={tid}
```

{% endcode %}

***

### Passo 2 : Instalar plugins

1. "WPCode – Insert Headers and Footers + Custom Code Snippets – WordPress Code Manager" por WPCode
2. "WooCommerce Conversion Tracking" por weDevs

#### Passos a seguir

1. Faça login no painel administrativo do WordPress.
2. Vá em "Plugins" e pesquise por "WooCommerce Conversion Tracking" & "WPCode – Insert Headers and Footers + Custom Code Snippets – WordPress Code Manager".

<figure><img src="/files/35cf2e301dc4db686ca8079afc619757e720b9fa" alt=""><figcaption></figcaption></figure>

3. Instale e ative "WooCommerce Conversion Tracking" & "WPCode – Insert Headers and Footers + Custom Code Snippets – WordPress Code Manager".

***

### Passo 3 : Colocação do Código

1. Vá para Código/Script **»** Header & Footer
2. Coloque o código abaixo no campo "Scripts in header"
3. Salvar configurações

```html
<script src="https://web-resources.offer18.net/sdk/web/WebSDK.js"></script>
<script>
    window.Offer18WebSDK.initializeConversion('<YOUR-CLICK-ID-PARAMETER>');
</script>
```

<figure><img src="/files/f11aee9533740277d387c46d98dc4167a199bf56" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Os usuários devem substituir '\<YOUR-CLICK-ID-PARAMETER>' pelo parâmetro clickid usado ao criar a oferta.
{% endhint %}

***

### Passo 4 : Coloque o script abaixo em Rastreamento de Conversões

1. Vá para Conversion Tracking (submenu da aba WooCommerce).
2. Habilite "Custom" e coloque o código abaixo em "Successful Order."
3. Salvar alterações

```html
<script>
    window.Offer18WebSDK.trackConversion({
        domain: '',
        accountId: '',
        offerId: '',
        coupon: '', 
        postbackType: '', // 'iframe' ou 'pixel'
        isGlobalPixel: false, // true ou false
        allowMultiConversion: false, // true ou false
        conversionData: {
            event: '', // Nome do Evento (Por favor especifique o evento)
            payout: '', // Valor do Payout (Por favor especifique o valor do payout)
            sale: '', // Valor da Venda (Por favor especifique o valor da venda)
            currency: '',
            adv_sub1: '',
            adv_sub2: '',
            adv_sub3: '',
            adv_sub4: '',
            adv_sub5: '',
        }
    })
</script>
```

<figure><img src="/files/0f187ee29f9f2ae670b66f87d687d7ca5b0382ab" alt=""><figcaption></figcaption></figure>

***

Você pode coletar dados de conversão usando vários Parâmetros de Postback do Offer18 e atributos de dados do WooCommerce.

| **Parâmetro de Postback do Offer18** | **Parâmetro do WooCommerce** |
| ------------------------------------ | ---------------------------- |
| sale                                 | {order\_subtotal}            |
| adv\_sub4                            | {order\_number}              |


---

# Agent Instructions: 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:

```
GET https://knowledgebase.offer18.com/pt/rede/integracao-de-e-commerce/woocommerce-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
