Shopify Plugin Documentation

BehaviorScoresDocumentation

“Stop discounting customers who'd buy anyway.”

Getting Started

What is BehaviorScores?

BehaviorScores is a Shopify app that uses machine learning to analyze customer behavior and determine who actually needs a discount to complete their purchase — and who would buy anyway.

The Problem

Most stores give the same discount to everyone. But studies show that 40-60% of customers who use discount codes would have purchased at full price.

The Solution

BehaviorScores analyzes each customer's purchase history, behavior patterns, and likelihood to convert, then makes real-time decisions about whether to offer a discount, a small nudge, or nothing at all.

Key Benefits

  • Save 20-40% of your discount budget
  • Maintain conversion rates while reducing discounts
  • Automatic optimization — set it and forget it
  • Data-driven decisions — no more guessing

Quick Start

  1. 1Install BehaviorScores from the Shopify App Store
  2. 2Click "Sync Data" to import your historical orders and customers
  3. 3Configure your discount rules (or use our recommendations)
  4. 4Go live and start saving

How It Works

The Scoring Process

BehaviorScores works in four steps:

1

Data Collection

When you install the app, we automatically import your historical order data and begin tracking customer behavior.

  • Purchase history (orders, values, frequency)
  • Customer lifetime value
  • Time between purchases
  • Discount usage patterns
  • Cart behavior
2

Score Calculation

Our algorithm analyzes each customer and assigns a Purchase Probability Score from 0 to 100.

3

Real-Time Decision

When a customer reaches checkout, BehaviorScores makes an instant decision.

4

Learn & Improve

After each transaction, we track outcomes to improve future predictions.

Score Ranges

Score RangeMeaningTypical Action
70-100High probability — will likely buy without discountNo discount
40-69Medium probability — might need a small nudgeSmall discount (5%)
0-39Low probability — needs incentive to convertFull discount (15%)

Decision Flow

text
Customer arrives at checkout
    ↓
Retrieve customer score
    ↓
Apply discount rules
    ↓
Show appropriate offer (or none)

Score Factors

FactorWeightDescription
Recency25%How recently did they last purchase?
Frequency25%How often do they buy?
Monetary20%What's their average order value?
Coupon Resistance15%Do they typically buy without coupons?
Return Rate15%Do they keep their purchases? (Low returns = higher score)

Installation

Requirements

  • Shopify store (any plan)
  • At least 30 days of order history (recommended)
  • Checkout extensibility enabled

Step-by-Step Installation

1. Install from App Store

Visit the Shopify App Store and click "Add app". You'll be redirected to authorize BehaviorScores.

2. Grant Permissions

BehaviorScores requires the following permissions:

PermissionWhy We Need It
Read ordersAnalyze purchase history
Read customersBuild customer profiles
Write discountsCreate and apply discount codes
Read productsUnderstand cart contents

3. Initial Data Import

After installation, we'll import your historical data:

  • < 1,000 orders: ~5 minutes
  • 1,000 - 10,000 orders: ~30 minutes
  • 10,000+ orders: ~2 hours

4. Wait for Analysis

Our algorithm needs time to analyze patterns. Minimum: 24 hours. Recommended: 48-72 hours for best results.

5. Configure & Go Live

Once analysis is complete, configure your discount rules and activate the app.

Dashboard Overview

Home / Overview

The main dashboard shows your key metrics at a glance:

KPI Cards

  • Decisions Today:How many checkout decisions were made
  • Savings This Month:Money saved by not giving unnecessary discounts
  • Conversion Rate:Overall conversion rate
  • Avg Score:Average customer score

Decisions View

ColumnDescription
TimeWhen the decision was made
CustomerCustomer identifier (anonymous or email)
ScoreCustomer's score at decision time
DecisionNo discount / Small / Full
Cart ValueCart value at checkout
ConvertedDid they complete the purchase?
SavingsAmount saved (if applicable)

Customers View

ColumnDescription
CustomerEmail or ID
ScoreCurrent score (0-100)
SegmentNew / Returning / Loyal / VIP / At Risk
OrdersTotal order count
Total SpentLifetime value
Coupon Rate% of orders with coupons
Last OrderDate of most recent purchase

Configuration

Score Thresholds

Define when each discount tier applies:

config
High Score Threshold: 70
  → Scores 70-100 get NO discount

Medium Score Threshold: 40
  → Scores 40-69 get SMALL discount
  → Scores 0-39 get FULL discount

Discount Values

SettingDefaultDescription
No Discount0%For high-score customers
Small Discount5%For medium-score customers
Full Discount15%For low-score customers

Exclusions

Excluded Collections

Products in these collections will not trigger BehaviorScores: Sale items, Already discounted products, Low-margin products.

VIP Tags

Customers with these Shopify tags will NEVER receive automatic discounts:

text
VIP Tags: vip, wholesale, employee

Understanding Scores

Score Scale

text
0 -------- 40 -------- 70 -------- 100
   LOW        MEDIUM        HIGH
  (needs     (might       (will buy
  discount)   need nudge)   anyway)

Score Confidence

ConfidenceMeaningData Available
HighVery reliable5+ orders
MediumFairly reliable2-4 orders
LowLimited data0-1 orders

Customer Segments

SegmentDescriptionTypical Score
NewFirst-time or very recent customerLow-Medium
Returning2-4 purchasesMedium
Loyal5+ purchasesMedium-High
VIPHigh frequency + high valueHigh
At RiskPreviously active, now inactiveMedium
ChurnedNo purchase in 180+ daysLow

Score Breakdown Example

text
SCORE BREAKDOWN

Recency:     +25 (purchased 5 days ago)
Frequency:   +20 (8 orders total)
Monetary:    +15 (avg order $85)
Coupon Use:  -10 (uses coupons 60% of time)
Return Rate: +5  (low return rate)
─────────────────
TOTAL:       55/100 (Medium)

Discount Rules

How Discounts Are Applied

  1. 1We generate a unique, single-use discount code
  2. 2The code is applied automatically at checkout
  3. 3Code expires after 24 hours if unused
  4. 4Customer sees the discount in their cart summary

Discount Display

text
┌─────────────────────────────────────┐
│  Cart Summary                       │
├─────────────────────────────────────┤
│  Subtotal              $120.00      │
│  Discount (SAVE5OFF)    -$6.00      │
│  Shipping               $5.00       │
│  ─────────────────────────────      │
│  Total                 $119.00      │
└─────────────────────────────────────┘

Note: Customers who don't receive a discount see no indication that discounts were considered — they simply see their normal checkout.

A/B Testing

A/B Testing allows you to test different discount strategies and measure their impact with statistical significance.

Available on Growth plan and above

Creating a Test

  1. 1.Go to Experiments → New Experiment
  2. 2.Name your experiment and define a hypothesis
  3. 3.Configure Control (current settings) and Variant (new settings)
  4. 4.Set traffic split (recommend 50/50)
  5. 5.Start the experiment

Reading Results

text
RESULTS

                Control     Variant
─────────────────────────────────────
Sample Size       524         518
Conversions       89          85
Conv. Rate       16.9%       16.4%
Avg Savings      $12.50      $8.30

Statistical Significance: 94%
Winner: Variant (saves more with similar conversion)

Statistical Terms

TermMeaning
Sample SizeNumber of customers in each group
Conversion Rate% who completed purchase
P-ValueProbability result is due to chance
ConfidenceHow sure we are about the winner
Lift% improvement of variant over control

Optimization Suggestions

Available on Growth plan and above

BehaviorScores analyzes your store's performance against similar stores in our network to identify improvement opportunities.

Example Suggestion

text
SUGGESTION

Your high-score threshold is 70%, but similar stores
in your segment perform better with 65%.

Current:   70% → No discount
Suggested: 65% → No discount

Potential Impact: +12% savings
Confidence: High (based on 47 similar stores)

[Start A/B Test]  [Apply Directly]  [Dismiss]

Integrations

Webhooks (Pro+)

Send real-time events to your own systems:

  • decision.madeWhen a discount decision is made
  • decision.convertedWhen a decision leads to purchase
  • score.updatedWhen a customer score changes
  • experiment.completedWhen an A/B test finishes

Webhook Payload Example

json
{
  "event": "decision.made",
  "timestamp": "2024-12-15T10:30:00Z",
  "data": {
    "shop_id": "shop_123",
    "customer_id": "cust_456",
    "score": 72,
    "decision": "no_coupon",
    "cart_value": 125.00
  }
}

API Reference

Available on Pro plan and above

Authentication

All API requests require an API key in the header:

http
Authorization: Bearer your_api_key_here

Get Customer Score

http
GET /api/v1/score/{customer_id}

Response:

json
{
  "customer_id": "cust_123",
  "score": 72,
  "confidence": "high",
  "segment": "loyal",
  "factors": {
    "recency": 85,
    "frequency": 70,
    "monetary": 65,
    "coupon_resistance": 45,
    "return_rate": 90
  },
  "updated_at": "2024-12-29T10:30:00Z"
}

Get Decision

http
POST /api/v1/decide

Request:

json
{
  "customer_id": "cust_123",
  "cart_value": 150.00,
  "product_ids": ["prod_1", "prod_2"]
}

Response:

json
{
  "decision": "small_coupon",
  "discount": {
    "type": "percentage",
    "value": 5,
    "code": "SAVE5XYZ123"
  },
  "reasoning": [
    "Customer score: 55 (medium)",
    "No excluded products",
    "Cart value above minimum"
  ]
}

Rate Limits

PlanRequests/minute
Pro60
Scale300
EnterpriseCustom

Webhooks

Configure webhooks to receive real-time notifications when events occur. All webhooks are signed with HMAC-SHA256 for security.

Available Events:

EventDescription
decision.madeTriggered when a discount decision is made at checkout
decision.convertedTriggered when a customer completes a purchase after a decision
score.updatedTriggered when a customer score is recalculated
experiment.completedTriggered when an A/B test finishes

Webhook Payload:

json
{
  "event": "decision.made",
  "timestamp": "2024-12-29T14:30:00Z",
  "data": {
    "shop_id": "shop_123",
    "customer_id": "cust_456",
    "score": 72,
    "decision": "small_coupon",
    "cart_value": 150.00
  }
}

Verifying Signatures:

javascript
const crypto = require('crypto');

function verifyWebhook(payload, signature, secret) {
  const expected = crypto
    .createHmac('sha256', secret)
    .update(payload)
    .digest('hex');
  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}

// Usage in your endpoint:
app.post('/webhook', (req, res) => {
  const signature = req.headers['x-behaviorscore-signature'];
  if (!verifyWebhook(JSON.stringify(req.body), signature, process.env.WEBHOOK_SECRET)) {
    return res.status(401).send('Invalid signature');
  }
  // Process the webhook...
});

Billing & Plans

Plan Comparison

FeatureFreeStarterGrowthProScale
Price$0$29$79$149$249
Decisions/mo505002,0005,00015,000
ML ScoringBasic
DashboardLimitedFullFullFullFull
Reports-
Suggestions--
A/B Testing--1/mo3/mo
Auto A/B---
API---
Integrations-13AllAll

What Counts as a "Decision"?

A decision is counted each time BehaviorScores evaluates whether to show a discount at checkout:

  • Customer reaches checkout
  • Decision is made (discount or no discount)
  • Regardless of whether customer converts

FAQ

General

Q: How long until I see results?

A: Most stores see measurable savings within the first week. Optimal performance typically comes after 2-4 weeks as the algorithm learns your customers.

Q: Will this hurt my conversion rate?

A: No. BehaviorScores is designed to maintain or improve conversion rates while reducing unnecessary discounts. The algorithm is conservative — when in doubt, it offers the discount.

Q: What if a customer complains about not getting a discount?

A: Customers who don't receive a discount simply see a normal checkout — there's no indication that a discount was considered. They're not being denied anything they expected.

Technical

Q: Does this work with my existing discount codes?

A: Yes. BehaviorScores creates its own unique codes. Your existing promotional codes, automatic discounts, and scripts continue to work normally.

Q: How does this affect checkout speed?

A: Decisions are made instantly at checkout — customers won't notice any delay.

Q: What about GDPR/privacy?

A: BehaviorScores only accesses data necessary for scoring (orders, customers). We don't collect personal data beyond what Shopify provides, and all data is processed securely.

Troubleshooting

Common Issues

"No decisions are being made"

Possible causes:

  • App not activated: Go to Settings and ensure "Active" is enabled
  • Still in learning mode: Wait 24-48 hours after installation
  • No checkout traffic: Decisions only happen at checkout
  • All products excluded: Check your exclusion rules

"All customers are getting discounts"

Possible causes:

  • Thresholds too high: Try lowering your high-score threshold
  • New store: With limited data, scores tend to be lower
  • Discount-heavy history: If most past orders used coupons, scores will be lower

Error Messages

ErrorMeaningSolution
RATE_LIMIT_EXCEEDEDToo many API requestsWait and retry, or upgrade plan
INVALID_CUSTOMERCustomer ID not foundCheck customer exists in Shopify
CHECKOUT_EXTENSION_ERRORExtension not loadingReinstall app or contact support
WEBHOOK_FAILEDCan't receive Shopify dataCheck app permissions

Getting Help

Email Support: support@behaviorscores.com

For urgent issues affecting checkout, email with subject line "URGENT: Checkout Issue" for priority handling.

Changelog

v1.1.0December 2025
  • Added A/B Testing (manual and automatic)
  • Added Optimization Suggestions
  • Improved scoring algorithm
  • New dashboard charts
v1.0.0November 2025
  • Initial release
  • Basic scoring
  • Dashboard
  • Shopify integration

Last updated: December 2025

Need help? Contact support@behaviorscores.com