Testing
Testing your integration
We recommend testing the Web SDK integration to ensure it's loading correctly and loading data attributes as expected.
You can follow the steps below to test your Rokt Ecommerce or Rokt Ads Web SDK integration.
Open a new window in your browser.
Open your browser developer tools panel. For most browsers, you can do this by right-clicking on your screen and clicking Inspect.
From the developer tools panel, go to the Network tab and type
experiences
into the filter bar.Navigate to the site and page where the Web SDK has been placed.
Note: Make sure you have the developer tools open before navigating to your site to ensure the
/experiences
call is recorded by the browser.In the Network tab of the developer tools panel, you should see at least one
/experiences
request. This indicates that the Web SDK loaded successfully.Click the
/experiences
request (it should have a status of 200). Check the Payload/Request tab to verify the data being shared with Rokt.Note: During testing, you might see another
/experiences
call with a 204 status. Make sure you are performing the check on the call with a 200 status.
Troubleshooting
The Rokt Web SDK provides contextual error reporting. If you are having trouble validating your integration, the best way to debug the issue is to check Console tab in the browser developer tools.
There may be other errors outside the Web SDK code. You may be experiencing one of the following common errors:
Syntax errors
Make sure you are not missing any commas in your integration code.
To check for syntax errors:
Go to the browser developer tools Console tab.
If the file where you placed the Web SDK has an error, it appears in the console. Click the file to see the code and error from the browser.
Any error is indicated in the file. In particular, check that all attributes are separated by commas as shown below.
Incorrect:
email: ''
emailsha256: '',
Correct:
email: '',
emailsha256: '',
Other common errors
- Make sure the script has been placed on the correct page.
- If you’re using a tag manager, make sure the triggers are set up correctly so the script loads on the right page.
Sandbox integration
With a sandbox integration, you can add a configuration flag to test against a sandbox environment. The sandbox environment follows a normal offers, bidding, and matching process against your production configuration. While a sandbox environment is part of the Rokt production environment, it does not charge advertisers or generate referrals. As a result, you can use it for acceptance testing before deploying to production.
The integration follows the same steps as in previous examples, with an additional sandbox flag required in the initialization function.
See Rokt.createLauncher for more details on the method.
const launcher = await createLauncher({
accountId: 'rokt-account-id',
sandbox: true,
});
Once the sandbox flag is set you should see Rokt's solution executing API calls against https://apps-demo.rokt.com
instead of production https://apps.rokt.com
ensuring sandboxing works correctly.
The sandbox
flag should only be used in testing environments.