> For the complete documentation index, see [llms.txt](https://ctracker-docs.keywordrush.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ctracker-docs.keywordrush.com/running-your-site/sandbox.md).

# The sandbox

Setting up a cashback site asks you to make decisions before you have anything to judge them by.

How long should cashback sit before a member can withdraw it? What is a fair minimum payout? Is your referral bonus generous, or is it going to cost you money? Does your account page actually make sense to somebody looking at their own balance?

Normally you find out months later. First a network has to approve you, then a real shopper has to buy something through your link, then that sale has to be confirmed. By the time you can see whether your settings were sensible, changing them means explaining yourself to members who already have money on the site.

The sandbox lets you see all of it today. It fills your site with invented shops, members, orders and payout requests so you can watch the whole thing work, decide what to change, and then delete every trace of it.

### What is invented and what is real

Only the shops and the shoppers are made up.

Everything that happens *after* an order arrives is the real thing: your holding period, your currency conversion, your referral rules, your payout minimum, the balances on the account page, and the emails your members would receive. Those are not simulated for the demonstration — they are the same workings your live site will use.

So if a balance looks wrong during a rehearsal, it would have been wrong for a real member too. That is exactly what you want to find out now.

### Finding it

Go to `Cashback Tracker` → `Sandbox`.

That menu item is there while your site is still being set up, and disappears by itself once real cashback orders start arriving. If you cannot see it, your site already has real orders — and the sandbox is not meant for a site that has gone live.

### Switching it on

Turning the sandbox on takes one deliberate step outside the admin, so that nobody can start it by clicking the wrong thing.

**Step 1.** Open your site's `wp-config.php` file and add this line, just above the line that reads `That's all, stop editing!`:

```php
define( 'CBTRKR_SANDBOX', true );
```

You will need your host's file manager, or FTP, to edit that file. If you are not comfortable doing it, your host's support team will do it for you in a couple of minutes.

**Step 2.** Go back to the `Sandbox` screen, reload it, and choose **Turn the sandbox on**.

{% hint style="info" %}
The sandbox stays on until you switch it off — there is no time limit, so a rehearsal that takes you a few weeks will not stop halfway through. Leaving it on cannot affect a real member: their emails always go to them, and the moment your first real order arrives the sandbox stops adding anything to your site.
{% endhint %}

![The Sandbox screen](https://3545740495-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M69sU0hfZj3QsteYxmI%2Fuploads%2Fgit-blob-679c5df9da29f2ad2b639819b0b77614e511afb1%2Fsandbox-screen.webp?alt=media)

### If your site already has cashback data

The sandbox only runs on a site with no cashback orders and no member balances.

That is deliberate rather than awkward. It is what lets you press **Remove sandbox data** later without stopping to think about what else might go with it.

{% hint style="warning" %}
**Upgrading from version 2?** Do your rehearsal on a copy of your site, not the live one. Ask your host for a staging copy — most offer this with one click — and try version 3's balances, payouts and member area there.
{% endhint %}

If the site in front of you is a practice install whose contents you genuinely do not care about, the screen offers **Clear this site for sandbox use**.

{% hint style="danger" %}
**Clearing a site permanently deletes its cashback data** — every order, every member balance, every payout, and the shop information imported from your networks. It cannot be undone.

Before it does anything, the screen shows you exactly what would be lost, including how many members hold a balance and how much money that adds up to. Read those numbers. Then type `reset` to confirm.

Never do this on a site where real members are owed money.
{% endhint %}

### Making the test data

Tick what you want and choose **Generate**. You can run it as often as you like, and each run adds more — a fresh batch of orders every time, at different amounts and dates, rather than the same ones over again. Generate a few times if you want a busier site to look at. The shops are a fixed set of 25, so those are only created once however often you run it.

* **Shops and coupons** — 25 shops across six categories. They are deliberately varied: some pay a percentage of the sale, others a flat amount, and they trade in several different currencies, so you can check your currency settings on something other than a single example. Each shop gets a few coupons, some needing a code and some not.
* **Members** — test accounts that behave like real members everywhere in the admin.
* **Referrals** — connects the members up, so some of them referred others, each relationship carrying the referral terms you have set right now. If referrals are switched off, or every referral amount is still zero, the run says so rather than reporting a count: the chain would be recorded and no approved order could ever pay a penny along it.
* **Orders** — purchases dated across the past two months. Some are old enough to have cleared your holding period; others are still waiting it out. Having both at once is what makes a member's balance worth looking at. Each run also puts a few members comfortably past your payout minimum so there is something to practise the payout queue on, and it picks different members each time, so nobody stays poor for ever. These start off at the Sandbox network and you collect them in the next step, the way real orders reach your site.
* **Payout requests** — one at each stage, so you can practise approving, rejecting and marking payouts as paid.

### Collecting the orders

The orders do not appear in your admin straight away, and that is on purpose.

It helps to know how this works with a real network. When somebody buys something through one of your links, that sale is recorded **at the affiliate network**, not on your site. Your site asks the network for new orders a few times a day, and only then do they show up in your `Orders` list and change anybody's balance.

The sandbox does the same thing. The orders it generates start off at the Sandbox network — they are not on your site yet — and your site collects them exactly as it would collect real ones. The only difference is that you get a button, so you are not waiting hours for the next automatic check.

Choose **Collect the orders now**.

This is the moment each click gets matched back to the member who made it, so it is worth watching. If the balances look right afterwards, your tracking links are set up correctly — which is the single hardest thing to be sure of before you have real shoppers.

### What to look at

This is the part that pays for the rehearsal. Once the orders are in:

* **Open a member's account page.** Is the split between pending and available money obvious to somebody who is not you? Does the wait feel reasonable, or would you be emailing support about it?
* **Check the holding period.** Members with older orders should have money available; newer ones should not. If everything is available at once, your holding period may be shorter than you meant.
* **Look at a shop page.** Is the cashback figure right for a shop paying a flat amount, and for one paying a percentage? Are the shops in other currencies showing sensible numbers?
* **Walk the payout queue.** Approve one, reject one, mark one paid. Is your minimum payout reachable, or would a member wait a year to hit it?
* **Read the emails.** They arrive in your own inbox — see below. Do they say what you would want to receive?
* **Check the referral bonuses.** Add up what a referrer earns. Would that still make sense with a thousand members?

### Testing a postback

Some networks tell your site about a sale the moment it happens, rather than waiting for your site to collect orders later. Setting that up correctly normally means asking the network to send you a real one and hoping you had it right.

**Send a test postback** sends one to your own site instead, using the settings you have entered for that network. If something is wrong, you find out now rather than after losing a real member's cashback.

Two things are worth trying:

* **Report the sale as** — the choices here are the words you yourself entered on the network, under approved and declined statuses. Send one as approved and check it arrives approved. If it lands as pending instead, those words do not match what the network actually sends, and on a live site every order would sit pending for ever with nothing to tell you why.
* **Sale amount** — the cashback is worked out from this. Try a deliberately large figure to see whether the maximum you set on the network turns it away.

If postbacks are switched off for your site, the button is disabled and says so. A real network would be turned away in exactly the same way, so this is worth fixing before you hand anyone your postback address.

### Things worth knowing

* **The emails come to you.** While the sandbox is on, every message that would go to a member is sent to your site's admin address instead. That is how you get to read them before your members do.

  Do check they are switched on first, under `Cashback Tracker` → `Settings` → `Member area`. A site upgraded from version 2 starts with all of them off, deliberately, so that upgrading does not begin mailing your members unannounced — which means you would receive nothing and reasonably conclude something was broken.
* **Generating data does not send emails.** The orders it creates are dated weeks in the past, and announcing them today would be nonsense — as well as putting several dozen messages in your inbox at once. Emails are sent for things you do afterwards: approving a payout, or moving an order from pending to approved. Those are happening now, so they behave exactly as they would on a live site.
* **You can sign in as a test member, while the sandbox is on.** That is the point of it: the account page is the part your members actually live in, and reading about it is not the same as looking at it.

  Nobody knows the password — it is generated at random and thrown away, so there is nothing to look up. Give the account one yourself: `Users`, edit the test member, **Set New Password**. Then sign in from a private browser window, and your admin session stays open in the other one. That is the only way to watch both halves of a payout at once: the member requesting it, and the queue it lands in.

  Switch the sandbox off and those accounts stop signing in again. A forgotten test account on a site that has gone live can never become a way in.
* **The invented shop pages are real pages.** They are published, and anyone visiting your site can see them. On a site nobody knows about yet that is harmless — but do clear them out before you announce yourself.

### Clearing up

**Remove sandbox data** lists exactly what it is about to delete before you press it, and deletes nothing that is not on that list. Orders and members from your own affiliate networks are not included.

It is safe to use at any time, whether the sandbox is on or off, so you can tidy up long after you have finished rehearsing.

{% hint style="info" %}
If your site was set up with the old **Demo** network, that data is listed too, and removing sandbox data removes it as well. Demo was a test network that no longer exists, so this is usually what you want — but it is your data, so the screen names it separately rather than quietly counting it as the sandbox's.
{% endhint %}

### Before you go live

* You are happy with your holding period, your minimum payout and your referral bonuses.
* You have used **Remove sandbox data**, and the invented shops are gone from your site.
* The `CBTRKR_SANDBOX` line has been taken back out of `wp-config.php`.
* `Cashback Tracker` → `Networks` shows your real network, and Sandbox is switched off.
