Skip to main content

Testing

Testing your integration

We recommend testing the Web SDK integration to ensure it's loading correctly and loading data attributes as expected.

Before you begin

You can follow the steps below to test your Rokt Ecommerce or Rokt Ads Web SDK integration.

  1. Open a new window in your browser.

  2. Open your browser developer tools panel. For most browsers, you can do this by right-clicking on your screen and clicking Inspect.

  3. From the developer tools panel, go to the Network tab and type experiences into the filter bar.

  4. 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.

  5. 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.

  6. 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.

Web SDK integration testing

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:

  1. Go to the browser developer tools Console tab.

  2. 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.

    Web SDK integration testing

  3. 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: 'roktAccountId',
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.

note

The sandbox flag should only be used in testing environments.

Was this article helpful?