> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gocertify.me/llms.txt
> Use this file to discover all available pages before exploring further.

# Via Shopify Flow

> Track orders and refunds automatically using Shopify Flow.

If your store runs on Shopify, you can track conversions without adding any code to your
site. Two ready-made Shopify Flow workflows send order and refund data to Gocertify
automatically.

<Warning>
  With this integration you share **all** of your transactions with Gocertify, not only
  those that used a Gocertify discount code. We then classify each transaction based on
  the discount code the shopper used.
</Warning>

<Info>
  Shopify's [**Send HTTP request**](https://help.shopify.com/en/manual/shopify-flow/reference/actions/send-http-request) action is available on the Grow,
  Advanced and Plus plans. On any other plan, use [Direct Conversion Tracking](/section/trackImpact/directTracking)
  instead.
</Info>

## Before you start

Two separate steps are needed before the workflows will work:

1. **Install the Gocertify app** on your store.
2. **Connect your brand** to the store.

See the [Shopify Integration guide](/section/promoteOffers/shopifyIntegration) for both.
Installing the app on its own is not enough — connecting your brand is what tells the
workflows which account to send data to.

You will also need your Gocertify API key. Ask your Gocertify contact for it — they will
provide the key for your account.

## Download the workflows

<CardGroup cols={2}>
  <Card title="Order Created" icon="cart-shopping" href="https://cdn.gocertify.me/downloads/shopify-flows/gocertify-order-created.flow">
    Sends every new order to Gocertify.
  </Card>

  <Card title="Refund Created" icon="rotate-left" href="https://cdn.gocertify.me/downloads/shopify-flows/gocertify-refund-created.flow">
    Sends every refund so your reporting stays accurate.
  </Card>
</CardGroup>

## Set up

<Steps>
  <Step title="Add your API key as a secret">
    In your Shopify admin, go to **Apps > Flow > Settings** and click **Add secret**.

    <Frame caption="Flow settings, where secrets are managed">
      <img src="https://mintcdn.com/gocertify-db9cc6b8/LC2oqKR6NbuScsQM/images/integrations/ecommerce/shopify/flow/shopify-flow-secrets-empty.png?fit=max&auto=format&n=LC2oqKR6NbuScsQM&q=85&s=e1e6eccac4c880d6361f44ba91e57cb7" alt="Shopify Flow settings page with the Add secret button" width="1206" height="850" data-path="images/integrations/ecommerce/shopify/flow/shopify-flow-secrets-empty.png" />
    </Frame>

    | Field  | Value                                   |
    | ------ | --------------------------------------- |
    | Handle | `gocertify_api_key`                     |
    | Value  | The API key from your Gocertify contact |

    <Frame caption="Fill in the handle and paste your API key">
      <img src="https://mintcdn.com/gocertify-db9cc6b8/LC2oqKR6NbuScsQM/images/integrations/ecommerce/shopify/flow/shopify-flow-add-secret.png?fit=max&auto=format&n=LC2oqKR6NbuScsQM&q=85&s=10545c548a3ba9ead264e69d0e0768d2" alt="Add secret form with the gocertify_api_key handle entered" width="1982" height="984" data-path="images/integrations/ecommerce/shopify/flow/shopify-flow-add-secret.png" />
    </Frame>

    <Warning>
      The handle must be exactly `gocertify_api_key`. The workflows will not
      authenticate if it differs.
    </Warning>
  </Step>

  <Step title="Import both workflows">
    Go to **Apps > Flow** and click **Import** in the top-right corner. Add the
    `Order Created` file and confirm, then repeat for `Refund Created`.
  </Step>

  <Step title="Add the brand variable">
    Each workflow needs one variable that tells it which Gocertify account to send data
    to. You add it once per workflow.

    Open the workflow, click the **Send HTTP request** step, then under the **URL** field
    click **Add variable**.

    <Frame caption="Select shop from the variable list">
      <img src="https://mintcdn.com/gocertify-db9cc6b8/LC2oqKR6NbuScsQM/images/integrations/ecommerce/shopify/flow/shopify-flow-variable-select-shop.png?fit=max&auto=format&n=LC2oqKR6NbuScsQM&q=85&s=b2324c1238841610db5930e151a436c6" alt="Add a variable panel showing the order and shop resources" width="1244" height="614" data-path="images/integrations/ecommerce/shopify/flow/shopify-flow-variable-select-shop.png" />
    </Frame>

    1. Select **shop**.
    2. Next to **metafield**, click the **+** icon.
    3. Choose **Use an unstructured metafield**.
    4. Enter `gocertify.brand_slug` as the namespace and key. The variable name fills in
       as `brandSlug` automatically — leave it as it is.
    5. Click **Add**.

    <Frame caption="Enter the namespace and key">
      <img src="https://mintcdn.com/gocertify-db9cc6b8/LC2oqKR6NbuScsQM/images/integrations/ecommerce/shopify/flow/shopify-flow-variable-namespace.png?fit=max&auto=format&n=LC2oqKR6NbuScsQM&q=85&s=1ea2816abecba6d344569db4ed2348f3" alt="Create variable panel with gocertify.brand_slug entered as the namespace and key" width="1232" height="1144" data-path="images/integrations/ecommerce/shopify/flow/shopify-flow-variable-namespace.png" />
    </Frame>

    The URL will now resolve to your brand automatically. Open the **Test results** tab to
    confirm — you should see your brand name in the URL instead of the variable.

    <Warning>
      The variable must be named exactly `brandSlug`. Repeat this step for the second
      workflow — variables are not shared between workflows.
    </Warning>
  </Step>

  <Step title="Turn on the workflows">
    Open each workflow and click **Turn on workflow** in the top-right corner. Nothing else
    inside the workflow needs changing.
  </Step>

  <Step title="Check it works">
    Place a test order. Within a minute or two it should appear in your Gocertify
    dashboard. If it does not, go to **Apps > Flow > Recent runs** to see whether the
    workflow ran and what it returned.
  </Step>
</Steps>

## What gets sent

<AccordionGroup>
  <Accordion title="When an order is created">
    Order ID and name, creation time, order value and currency, discount codes applied,
    number of products, and Shopify's own fraud risk assessment.
  </Accordion>

  <Accordion title="When a refund is created">
    Refund ID, the original order it belongs to, and the refunded amount.
  </Accordion>
</AccordionGroup>

No customer names, email addresses or payment details are sent.
