> This page is for Applications Protection.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.humansecurity.com/llms.txt.

# Adobe Analytics

This document provides a basic integration guide for using HUMAN’s binary result flag to enrich Adobe Analytics.

## Prerequisites

* Appropriate access in Adobe Analytics to create [Conversion Variables (eVars)](https://experienceleague.adobe.com/en/docs/analytics/admin/admin-tools/manage-report-suites/edit-report-suite/conversion-variables/conversion-var-admin)
* Access to update your website code
* [Score reporting](/applications/score-reporting) enabled and set to **binary** with a threshold of **100**
* If you want to also send enriched data, then you need [data classification enrichment](/applications/data-classification-enrichment) enabled

## JavaScript integration

The data from HUMAN is returned as an event. To receive the event, you must store the following functions in an Adobe eVar.

> **Note**
>
> `APPID` will be equal to your app ID. For example if your APPID is `PX12345678`, then your function variable will be `window.PX12345678_asyncInit`.

**`Score reporting event`**

```javascript title="Score reporting event"
window.APPID_asyncInit = function(px) { // replace with your app ID
   px.Events.on('score', function(score) {
     // Set your action for the score here
     // The score can go to another variable or function
     try {
       // Set eVar for Adobe
       window.digitalData.page.pageInfo.attributes.pxbs = score;
     } catch (err) {
       console.log("error: " + err);
     }
   });
};
```

**`Data enrichment event`**

```javascript title="Data enrichment event"
px.Events.on('enrich', function (value) {
  // value - the enriched data, in the form of <HMAC>:<Base64 encoded data>
  const base64Data = value.split(":")[1]; // split value to get the base64 encoded data
  const dataStr = atob(base64Data); // base64 decode the enrichment data
  const data = JSON.parse(dataStr); // get the data as JSON
  window.digitalData.page.pageInfo.attributes.pxfId = data['f_id']; // get f_id data
  console.log('DATA', data);
});
```

## Add the JS to your domain

The JavaScript integration can be added to your existing HUMAN JavaScript snippet.

```javascript
<script type="text/javascript">
(function() {

    // Adobe Integration added here
  window.PX12345678_asyncInit = function(px) {
    px.Events.on('score', function(score) {
      // Set your action for the score here
      // The score can go to another variable or function
      try {
        // Set eVar for Adobe
        window.digitalData.page.pageInfo.attributes.pxbs = score;
      } catch (err) {
        console.log("error: " + err);
      }
    });
  };
// Custom parameters
// window._pxParam1 = "<param1>";
var p = document.getElementsByTagName('script')[0],
  s = document.createElement('script');
s.async = 1;
s.src = '//client.perimeterx.net/PX12345678/main.min.js';
p.parentNode.insertBefore(s, p);
}());
</script>
```