Docs

Contents

Concepts
Hypertune UI and Chrome DevTools Extension
Website Integration and Snippet
Security and GDPR
API and Server-Side Integration
Questions?

Concepts

Hypertune offers reinforcement learning as a service.

Currently this takes the form of evolutionary optimization over a discrete multivariate distribution, where the primary use case is optimizing website conversion rates.

You can define a campaign with a set of discrete variables, where each variable can take on a finite set of values.

For a given user and campaign, you can query Hypertune for a combination of values to use. Hypertune remembers which users received which combinations of values.

You can send user events back to Hypertune which are aggregated to calculate performance metrics for different combinations of values.

Over time, Hypertune learns what combinations of values perform best and returns them more often. The evolutionary algorithm automatically balances exploration and exploitation of the search space.

Note that the campaign unit doesn’t need to be a “user”. It could be a “request” or another object that can be assigned a combination of values.

Hypertune UI and Chrome DevTools Extension

The UI to view, create and edit campaigns and events can be accessed in the browser at https://app.hypertune.ai or via the Chrome DevTools extension.

The Chrome DevTools extension has extra features that make setup and preview easier for website campaigns and events.

Hypertune gives you abstractions for website campaigns that make integration easier:

For each campaign, you can define “targeting” to specify when a campaign should activate on your website.

Similarly, for each event, you can define targeting to specify when the event should fire on your website.

For each campaign variable value, you can define idempotent JavaScript that renders a website change. You can do this with custom code or the low-code editor.

Website Integration and Snippet

To use these abstractions, you just need to insert a one-line code snippet in the <head> of your website. Here's an example snippet:

<script src="https://hypertune.global.ssl.fastly.net/js/hte65a4e96a78086399ef8118298aa6c24.js"></script>

The snippet loads a JavaScript file hosted by Fastly, a CDN with global coverage and extremely low latency. It typically takes under 50ms to load and so does not impact the user experience.

At a high level, it:

> Generates and caches a UUID for the user.
> Fires events based on their targeting and logs them to the Hypertune backend.
> Determines which campaigns to activate based on their targeting.
> Assigns the user to a combination of values for each active campaign.
> Logs assignments to the Hypertune backend.
> Renders website changes by executing the JavaScript associated with each variable value.

There is no flickering or flash of original content as Hypertune hooks into the browser’s paint lifecycle and uses the DOM mutation observer API to re-execute the (idempotent) rendering code on every DOM mutation, starting from the first paint. This means that as the page progressively loads, changes defined in Hypertune are immediately applied to the DOM so the user can never see the original version.

In addition to re-executing the rendering code on every DOM mutation, Hypertune re-evaluates campaign and event targeting too. This makes the snippet compatible with dynamic JavaScript environments like single-page apps.

The snippet code is minified and compressed so the payload size is small. And the actual code is minimal so does not result in performance issues affecting the user experience.

This video tutorial walks you through setting up a website campaign:

This video tutorial walks you through viewing and interpreting campaign results:

Security and GDPR

Hypertune does not collect personally identifiable information (PII) so is GDPR compliant. All user events and assignments to specific combinations of values are saved against anonymous UUIDs (universally unique identifiers).

We do not store the user IDs specific to your application. It’s up to you to associate Hypertune’s UUIDs with your own user IDs if you need to.

All API calls to Hypertune’s backend made by the snippet code are over HTTPS.

Hypertune’s web servers and databases are hosted via Google Cloud Platform.

The snippet code contains details of your campaigns and events. It’s hosted by Fastly and publicly accessible.

API and Server-Side Integration

For website campaigns, the Hypertune UI and website snippet is typically enough to get started. But for other use cases, you might need to interact with the API directly.

The Hypertune API has 2 main methods:

POST /api/assign/{campaignId}

This will generate a UUID for the user, assign the user to a combination of values and record the assignment in the backend. It returns the UUID and a variableIdToValue map. Here's an example response:

{
   unitUuid: "df3af26c-08db-481a-96c2-8f5445fafd9f",
   variableIdToValue: {
       "1025": 1,
       "1027": 0,
       "1028": 1,
       "1029": 2,
       "1030": 2
   }
}

You should save and reuse the returned variableIdToValue for the same user to ensure a consistent user experience. You can use the returned unitUuid to log user events to Hypertune:

POST /api/event/{eventTypeId}

JSON body: { unitUuid: string, value: number }

This will record an event against the given unitUuid. You can optionally pass a numeric “value” field for real-valued events like revenue.

Both of these methods are hosted via Cloudflare Workers and so return with extremely low latency — typically under 50ms.

The API is currently in closed beta. If you’d like to use it, please get in touch via the live chat so we can discuss your use case and personally onboard you.

Questions?

If you have any questions, don’t hesitate to reach out on the live chat or book a video call with us.

Get started for free