Skip to navigation

Deploy manually

Deploy Page Intelligence manually.

HUMAN recommends deploying Page Intelligence through a tag manager, such as Google Tag Manager. Manual deployment, and especially client-side HUMAN response decryption, can expose the IVT detection logic.

Deploy Page Intelligence manually when you add the detection tag directly to your landing page header. Review the integration options guide before you begin.

Prerequisites

Before you deploy Page Intelligence manually, ensure you meet the following requirements:

  • You have access to your landing page code.
  • You have a Page Intelligence tag and regex pattern from HUMAN.

Deploy the Page Intelligence tag

To deploy the Page Intelligence tag manually, add the script tag from HUMAN directly to the header section of the page.

For example:

<html>
<head>
<...>
<script src="https://human-url/pgi.js?dt=*********"></script>
<...>
</head>
<body>...</body>
</html>

Decrypt the IVT response

To manually decrypt and store the HUMAN IVT response:

  1. Create a global JavaScript object that runs before the Page Intelligence tag executes. This object acts as an event handler when the Page Intelligence tag returns an IVT response.
  2. Include the object’s name when you invoke the Page Intelligence tag in the data-pgi-dis-hold tag attribute.
  3. Inside the object, define a callback method called dispatch that receives the encrypted IVT response as an argument.
  4. Inside the dispatch method, decrypt the IVT response by matching it with the regex key HUMAN provided.
  5. Optionally, based on the decrypted IVT response, invoke additional logic such as ad serving, blocking, or reporting.

For example:

<script>
/**
* Global callback object (must be defined on window).
* Its name should match the value of the `data-pgi-dis-hold` attribute
* in the Page Intelligence tag.
*/
window.hmnsPgiEvent = {
/**
* Callback function (must be called 'dispatch') that receives events
* from the Page Intelligence script.
* @function
* @param {Object} arg - The event payload.
* @param {string} arg.event - miDec.
* @param {string} arg.value - An obfuscated IVT TRUE/FALSE decision.
*/
dispatch: (arg) => {
const hmnsRegex = /REGEX GOES HERE/;
const hmnsIvtDec = ! hmnsRegex.test(arg.value);
if(hmnsIvtDec)
// Logic to handle IVT (not valid)
else
// Logic to handle not-IVT (valid)
}
};
</script>
<script src="https://human-url/pgi.js?dt=*********" data-pgi-dis-hold="hmnsPgiEvent" async="true"></script>

In the example above:

  • The global object is window.hmnsPgiEvent.
  • You pass the object’s name to the Page Intelligence script in the data-pgi-dis-hold tag attribute.
  • The required dispatch callback method includes:
    • The regex key HUMAN provided.
    • Regex pattern matching:
      • If the pattern matches the response, classify the traffic as valid (not IVT).
      • If the pattern does not match the response, classify the traffic as invalid (IVT).
    • The match result, a boolean value, is negated and stored in the constant hmnsIvtDec. When hmnsIvtDec is true, the traffic is IVT. When hmnsIvtDec is false, the traffic is not IVT. Note the inverted logic compared to the regex pattern matching above.

Use the hmnsIvtDec variable to trigger additional workflows as needed (see Mitigation strategy).