# Advanced Configuration

## Customising Integration Triggers

In some cases, there may be a requirement to customise which traffic triggers the Netacea integration within a single Fastly service traffic.

This could be for various reasons, including:

* Multiple domains exist on the same Fastly service, and Netacea protect each domain with a separate set of Datastream models
* Multiple domains exist on the same Fastly service, but Netacea only protect a subset of those domains
* The Netacea Integration needs to be limited to trigger and protect a limited set of pathways
* The Netacea Integration needs to [behave differently](/overview/integration-modes.md) based on certain criteria

To support customised triggers, follow the steps outlined below.

{% hint style="warning" %}
Do not complete this configuration without discussing the steps with the Netacea team
{% endhint %}

## Update the Netacea Dictionary

Update the Netacea dictionary configured as part of the standard [Installation and Configuration Guide](/netacea-plugin-information/fastly-magento/installation-and-configuration.md#create-an-empty-dictionary). The dictionary must be updated to include the variables and values normally set in the [Netacea Module](/netacea-plugin-information/fastly-magento/installation-and-configuration.md#apply-customer-keys-to-the-module).

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

The Netacea module fields should be set to blank:

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

## Create & Customise the recv\_configure.vcl

Lastly, the recv\_configure.vcl will need to be created to include the conditional statements that define how the Netacea integration triggers:

* Cause the integration to trigger on a subset of requests made on the Fastly service.
* Define which Datastream credentials are used when traffic triggers the integration on the Fastly Service.

Navigate to Stores → Configuration → Advanced → System → Full Page Cache → Fastly Configuration → Custom VCL Snippets and click "Create".

<figure><img src="/files/6tMUNwhJ7i7pFlFWG2v6" alt=""><figcaption></figcaption></figure>

#### Selective trigger

The following example will cause the integration to trigger on login specific request pathways.

<pre><code>set req.http.x-netacea:edge_config_key_prefix = "";
declare local var.should_run_netacea BOOL;

set var.should_run_netacea = false;

# Must enable Netacea on the following paths if using captcha:
if (!var.should_run_netacea) {
  if (req.url.path ~ "^/AtaVerifyCaptcha|^\/Mitigations\/") {
    set var.should_run_netacea = true;
  }
}

<strong>if (!var.should_run_netacea) {
</strong>  if (req.url.path ~ "\/.*\/(login)\/") {
    set var.should_run_netacea = true;
  }
}

if (var.should_run_netacea) {
  call netacea_check_req;
}
</code></pre>

#### Splitting trigger

The following example will cause the integration to use different Datastream credentials based on the request's associated domain.

```
declare local var.should_run_netacea BOOL;
set var.should_run_netacea = false;

# Must enable Netacea on the following paths if using captcha:
if (!var.should_run_netacea) {
  if (req.url.path ~ "^/AtaVerifyCaptcha|^\/Mitigations\/") {
    set var.should_run_netacea = true;
  }
}

#
if (!var.should_run_netacea) {
  if (req.http.host ~ "example.com") {
    set var.should_run_netacea = true;
    set req.http.x-netacea:edge_config_key_prefix = "dsA_";
  }
}

if (!var.should_run_netacea) {
  if (req.http.host ~ "example2.com") {
    set var.should_run_netacea = true;
    set req.http.x-netacea:edge_config_key_prefix = "dsB_";
  }
}

if (var.should_run_netacea) {
  call netacea_check_req;
}

```

## Update Log Shipping

Lastly, you may need to update your Shipping configuration based on requirements defined by the Netacea Team.


---

# 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://docs.netacea.com/netacea-plugin-information/fastly-magento/installation-and-configuration/advanced-configuration.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.
