Verify Installation
Verifying means proving Smart Code actually runs on a real URL — not only that you copied a snippet. CROForge can open the page with a special query flag and wait for the snippet to send a short message back. If that handshake succeeds, the install is good enough for experiments to load.
Use this after every new site, after a tag-manager change, and after a CSP or consent-banner change that might block scripts.
Words used on this page
| Word | Everyday meaning | Meaning in CROForge |
|---|---|---|
| Verify | Check that something is really there | The Code-tab checker labeled “Check if SmartCode is installed properly on your URL” |
| Smart Code | A small program snippet on the site | Must load init.js for your workspace before verification can succeed |
| Snippet | A short piece of code to paste | The HTML or WordPress block from Websites and Apps → Code tab |
| init.js | The file that starts experiments | Confirm it appears in page source and returns HTTP 200 in Network |
| __smartcode_check | A flag added to the URL | Query parameter the checker appends, for example ?__smartcode_check=sc_… |
| postMessage | A browser note from one window to another | The opened page sends type: "SMARTCODE_CHECK" with a matching checkerId |
| SMARTCODE_CHECK | The name of that verification message | The message type the app listens for; origin must match the URL you entered |
| Domain | The website address host | Must be allowlisted; a wrong host looks like “invalid domain” |
| Allowlist | An approved list of hosts | Smart Code refuses to run if location.hostname is not on the list |
| CSP | A site policy that allows or blocks scripts | A common reason verify fails if app.croforge.com is not permitted |
| Adblock | A browser extension that blocks trackers | Can hide or block init.js so the checker never hears back |
| Debug | A way to inspect failures | A Debug tab/FAQ exists but may be commented out; prefer this Code-tab verify flow |
| Live Preview | A forced look at one variation | Optional manual check after a Running campaign exists |
| Control | The original experience in a test | If Control is assigned, you may see no visual change even when Smart Code works |
| Flicker | A brief flash of the original page | Not a verify failure by itself; it means the snippet ran late or CSS applied after paint |
Screenshot
Use this screenshot filename when you add a capture: verify-installation.png in docs/assets/placeholders/. Do not embed an image in this file.
In-app verification (recommended)
- Open Configurations → Websites and Apps → your site → Code / Smart Code tab.
- Find Check if SmartCode is installed properly on your URL.
- Enter a full URL on your domain. It must start with
https://orhttp://. - Run verify. The app opens the URL with
__smartcode_check(a uniquecheckerId) and listens for aSMARTCODE_CHECKpostMessagewhen Smart Code loads.
The in-product copy says the new tab closes automatically once the check is complete. In-product FAQs on the website-app page also cover this flow.
What must be true for success:
- The opened page is on the same origin you typed (the listener ignores other origins).
- Smart Code loads and sends
type: "SMARTCODE_CHECK"with the samecheckerId. - Nothing (CSP, adblock, consent wall, wrong snippet) blocked
init.jsbefore that message.
Manual checklist
Use this if the in-app checker fails or you want a second opinion.
- View page source and confirm the
init.jsscript for your workspace id, with idcro-forge-experiments-js. - Open DevTools → Network →
init.js→ status 200. - Create a simple Running campaign with broad URL targeting and visible CSS (for example a background color) so a winning Variant is obvious.
- Soft-refresh the page — the variation should apply when you are not assigned Control.
- Optional: use Live Preview from the campaign variations menu so you force a specific variation. See Preview mode.
Common failures
| Symptom | Likely cause |
|---|---|
| Script 404 | Wrong host, workspace id, or path. Confirm https://app.croforge.com/{workspaceId}/init.js?ver=1.0.0. |
| Invalid domain | Hostname is not allowlisted for this Smart Code build. Register the exact host under Websites and Apps. |
| No visual change | Campaign is not Running; URL or segment mismatch; Control was assigned; CSS is too subtle. |
| Verify fails | Script not in <head>, blocked by CSP or adblock, consent banner delaying scripts, or you verified a URL on the wrong domain. |
Deeper runtime behavior is in Smart Code runtime. Cookie consent and Debug UI may be hidden or commented out in the current build — do not wait on those screens to verify.