# Shoptin Testing

## Overview

[Shoptin](https://shoptin.io/) dynamically optimizes marketing consent based on a shopper's location. This helps merchants grow their email lists and ensure regional compliance while unlocking measurable repeat revenue in minutes.

The Intelligems + Shoptin integration empowers merchants to move beyond assumptions and use hard data to understand how dynamic marketing consent affects your bottom line.

By utilizing an Intelligems content test, you can split-test dynamic consent against standard, static Shopify consent to accurately measure the effect on conversion rates, Average Order Value (AOV), and more.

### Prerequisite: <a href="#prerequisite" id="prerequisite"></a>

* Ensure the Shoptin app is fully installed and configured on your Shopify store before starting this test.

## How It Works <a href="#how-it-works" id="how-it-works"></a>

Follow these steps to set up a Shoptin split test:

1. Create a new Intelligems Onsite Edit content test
2. Title the Control "Standard Shopify Optin" and the Variant "Shoptin"
3. For the Control, inject the following Javascript with a delay of 2500 ms. This sets the control group to display the standard Shopify opt in experience during checkout.

```
const res = fetch("/cart/update.js", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    attributes: {
      '_ig_shoptin_test': "false"
    },
  }),
})
```

4. For the Variant, inject the following Javascript with a delay of 2500 ms. This sets the variant group to display the dynamic Shoptin experience during checkout.

```
const res = fetch("/cart/update.js", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    attributes: {
      '_ig_shoptin_test': "true"
    },
  }),
})
```

5. In Shoptin under "Settings", enable the "A/B Test Mode" setting.

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

Now you're good to publish your test!<br>

<br>


---

# 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.intelligems.io/integrations/shoptin-testing.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.
