Skip to main content

Shopify Integration Guide

Shopify doesn’t have built-in external form webhooks, but you can embed the opt-in widget via script tag or iframe.

Step 1: Add the script

  1. In your Shopify admin, go to Online Store → Themes
  2. Click Actions → Edit Code (or the ... menu → Edit Code)
  3. Open theme.liquid in the Layout folder
  4. Paste your script tag just before </body>:
  5. Click Save
This adds the opt-in popup/widget to every page on your store.

Step 2: Configure trigger settings

In your Trackly opt-in configuration, set the trigger type (delay, on form submit, or exit intent) to control when the popup appears. The script handles everything automatically.

Method 2: Iframe on a Custom Page

  1. In Shopify admin, go to Online Store → Pages
  2. Click Add page
  3. In the page editor, click the <> (HTML) button to switch to code view
  4. Paste:
  5. Save and publish the page

Method 3: Shopify Flow + Webhook (for existing Shopify forms)

If you’re collecting phone numbers through Shopify’s native customer registration or checkout:
  1. Install Shopify Flow (free on Shopify Plus, or via the app store)
  2. Create a new workflow:
    • Trigger: Customer created (or Order placed)
    • Action: Send HTTP request
    • URL: https://api.tracklysms.com/api/v2/optins/webhook
    • Method: POST
    • Headers: X-Api-Key: trk_your_api_key_here, Content-Type: application/json
    • Body:
  3. Enable the workflow

Universal Methods

These bypass Shopify entirely:
  • Keyword opt-in: Add “Text JOIN to (555) 555-5555” to product descriptions or your store footer
  • QR code: Print on packaging, receipts, or marketing materials
  • Subscribe link: Add to your store navigation or post-purchase page