Optimly Developer Documentation

Optimly Connect

Install Optimly on a custom site

In short

Install through a shared layout and the site's normal pull-request workflow.

For React, Next.js, and other code-managed sites, install the generated snippet in the shared HTML document or layout that renders on every measured page.

Git workflow

  1. Bind the production hostname in Optimly Connect and copy the generated snippet.
  2. Create a customer-scoped branch in the website repository.
  3. Add the snippet once to the shared document or layout.
  4. Update CSP only if required for the Optimly script and collector origins.
  5. Open a focused pull request and use the site's existing review process.
  6. Deploy to an authorized test origin when available.
  7. Verify a test page view before enabling live collection.
  8. Merge and deploy through the site's normal production workflow.

Single-page applications

The beacon observes supported history navigation so client-side route changes can create page-view events without a full reload. Install one site-wide instance; do not mount a new script element from every route component.

Roll back

Disable the Site Insights site first when collection must stop immediately, then revert the focused installation change and deploy the previous revision.