# Installation and Configuration

### Prerequisites

To successfully integrate using Netacea, please ensure you have:

1. A Fastly version or 1.2.217+ or higher. That is the version where the Netacea Edge module for the integration is added.
2. Access to the relevant API keys and log shipping endpoints in the [Netacea portal](https://docs.netacea.com/netacea-plugin-information/accessing-your-integration-settings).

Customers will also need to open a support ticket with Magento to request Fastly to enable POST within their environment. We need to ensure that there are 2 pragmas enabled on your Fastly account that are not enabled by default.

Required Pragmas:

```
Pragma optional_param fix_unsent_body_drain true;
Pragma optional_param no_body_if_bereq_is_get_or_head true;
```

To enable the Pragmas raise a support ticket with Fastly/Magento support. These Pragmas cannot be added manually.

### Implementation Steps

* Log in to the Fastly/Magento web interface.
* Check the Pragmas outlined in the [prerequisite ](#implementation-prerequisites)section have been enabled by navigating to Stores → Configuration → Advanced → System → Full Page Cache → Fastly Configuration → Tools → List all versions.

<figure><img src="https://3359534748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8KQH1bDl0sVMvZgHUjkC%2Fuploads%2Fgit-blob-0a2f26dd3caca9a7e8b7c9ca9e1ccc7fb24f6c4a%2Fimage%20(10)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

* Show the latest VCL version and look for the Pragmas at the top of the VCL.

<figure><img src="https://3359534748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8KQH1bDl0sVMvZgHUjkC%2Fuploads%2Fgit-blob-b42a13258f2d54e3393b6545175cae5a58d4adde%2Fimage%20(5)%20(2)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Make a note of the current version should you need to roll back in the future.
{% endhint %}

### Create an empty Dictionary

Navigate to Stores → Configuration → Advanced → System → Full Page Cache → Fastly Configuration → Edge Dictionaries and click "Add Dictionary".

<figure><img src="https://3359534748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8KQH1bDl0sVMvZgHUjkC%2Fuploads%2Fgit-blob-65e87c3fa2946353f578fdd1c015f377b8050b94%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Create a dictionary with the name "netacea\_edge\_config", this can be left blank.

{% hint style="info" %}
This will only be populated when using [Advanced Configuration](https://docs.netacea.com/netacea-plugin-information/fastly-magento/installation-and-configuration/advanced-configuration) on the advice of Netacea
{% endhint %}

### Install the Netacea Edge Module

Navigate to Stores → Configuration → Advanced → System → Full Page Cache → Fastly Configuration → Fastly Edge Modules and click "Manage" on the Module Manager.

<figure><img src="https://3359534748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8KQH1bDl0sVMvZgHUjkC%2Fuploads%2Fgit-blob-af0382522aec6168550a56c679cc072072d49a28%2Fimage%20(38)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

* Tick the "Netacea Bot Detection integration" Edge Module and click "Save".

<figure><img src="https://3359534748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8KQH1bDl0sVMvZgHUjkC%2Fuploads%2Fgit-blob-51d0476a200659d68233292c52d21a43348d0085%2Fimage%20(41)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

### Apply customer keys to the Module

* Navigate to the Active Modules and click the "Netacea Bot Detection integration" Action cog.

<figure><img src="https://3359534748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8KQH1bDl0sVMvZgHUjkC%2Fuploads%2Fgit-blob-05e0349e35aee0ac419fb9283edbc4b1dde23f74%2Fimage%20(36).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3359534748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8KQH1bDl0sVMvZgHUjkC%2Fuploads%2Fgit-blob-0644bb0ac8cefcd88072c61b6f54687eb96f13c0%2Fimage%20(101).png?alt=media" alt=""><figcaption></figcaption></figure>

**Input the required fields**

<table><thead><tr><th width="157">Field</th><th>Value</th></tr></thead><tbody><tr><td>Integration Mode</td><td><p>BYPASS - Disables the Netacea integration entirely</p><p>INGEST - Passive mode to allow Netacea to collect and analyse traffic</p><p>MITIGATE - Active mode that will mitigate based on Netacea's Intent Analytics®</p><p>INJECT - Active mode for customers who wish to receive Netacea analytics at their backend and decide actions to take.</p></td></tr><tr><td>Netacea API Key</td><td>Provided by <a href="../accessing-your-integration-settings">Netacea portal</a></td></tr><tr><td>Netacea Secret</td><td>Provided by <a href="../accessing-your-integration-settings">Netacea portal</a></td></tr><tr><td>Encryption Key</td><td>Provided by <a href="../accessing-your-integration-settings">Netacea portal</a></td></tr><tr><td>Netacea cookie name</td><td><p>A suitable name for your mitigation cookie.</p><p><strong>For added security, do not include Netacea or Mitigation in this name.</strong></p></td></tr><tr><td>Netacea captcha cookie name</td><td><p>A suitable name for your Captcha tracking cookie.</p><p><strong>For added security, do not include Netacea or Mitigation in this name.</strong></p></td></tr><tr><td>Netacea ignore list - URL Paths</td><td><code>/static/,/media/</code></td></tr></tbody></table>

**Optional Fields - Can be set to blank unless discussed with the Netacea team**

<table><thead><tr><th width="278">Field</th><th>Value</th></tr></thead><tbody><tr><td>Real IP Header Name</td><td><p>Allows users to customise which header is used for the request's IP.</p><p>Leave <strong>blank by</strong> default to use Fastly standard <code>client.IP</code> field.</p></td></tr><tr><td>Use Relative Captcha Page Assets</td><td>If set to <code>true</code>, it ensures Captcha is served without references to the Netacea CDN. Otherwise it will embed full URL to Netacea CDN in Captcha HTML.<br>Leave <strong>blank by</strong> default to use HTML sitewide.</td></tr><tr><td>Captcha URL Path</td><td>Allows users to create an endpoint which always serve Captcha HTML. Useful when implementing captcha challenge for mobile apps.<br>Leave <strong>blank by</strong> default to use /ATAverify pathway.</td></tr><tr><td>Captcha Page Marker Header</td><td>Custom header that indicates if the response is Captcha page. Has to be in format of <code>name={{header name}}&#x26;value={{header value}}.</code></td></tr><tr><td>Captcha Page Marker Header</td><td><p>Applies a header to the users requests to show that a captcha has been served.</p><p>Leave <strong>blank by</strong> default.</p><p>Example value <code>name=X-Captcha-Served&#x26;value=true</code></p></td></tr><tr><td>Enable Captcha Content Negotiation</td><td>Handles the format of the Captcha page. when set to <code>true</code> then it's possible to for the integration to return get the Captcha page in form of JSON.<br>Leave <strong>blank by</strong> default to use HTML sitewide.</td></tr></tbody></table>

### Finishing Up

Check you have completed the following steps:

* Install the [Netacea ](#install-the-netacea-vcl)[Edge Module](#install-the-netacea-edge-module)
* Configured [log streaming](https://docs.netacea.com/netacea-plugin-information/monitoring-configuration#log-streaming-implementation-steps) to the S3 bucket provided
* Ensure no error warnings are appearing

You are now ready to deploy by clicking "Save Config"

{% hint style="info" %}
A Cache flush can sometimes be required. To do this go to System -> Cache Management and click "Flush Magento Cache"
{% endhint %}

Bot management will now be deployed on the Fastly/Magento environment. You can test the deployment is active by:

* Checking for the presence of the Netacea cookie on the website
* Viewing your reporting dashboard for traffic and mitigation
* Requesting Netacea review internal metrics
