Skip to content

Legacy Lens Inject

Lens Inject is a small JavaScript snippet that loads the Lens runtime directly into a WordPress theme or site footer. It predates the Lens for WordPress plugin and does not include the admin-side UI for connection, audience, layout, theme, or sync status.

If you are installing Lens on a new site, stop here and use the plugin instead. Continue reading only if you are maintaining an existing Lens Inject install or planning a migration off it.

The Lens for WordPress plugin gives you, in WordPress admin:

  • A connection flow that does not require pasting tokens into theme code
  • A master Enable widget switch
  • Audience control (signed-in users vs all visitors)
  • Layout and theme settings without code changes
  • A visible sync status indicator and error reporting
  • A clean uninstall path that does not leave script tags behind

A Lens Inject install gives you none of those. Configuration lives in theme code; sync status is invisible; mistakes require a developer to fix.

What: install the Lens for WordPress plugin from inside WordPress admin and configure it through the plugin’s settings page.

Who it’s for: every new site, every site under active maintenance, and every site whose owner is comfortable installing a WordPress plugin.

Steps: see Install and Activate and Connect to TMXIO.

Migrate from Lens Inject to Lens for WordPress

Section titled “Migrate from Lens Inject to Lens for WordPress”
  1. Confirm Lens for WordPress is supported on this site. Check WordPress and PHP versions against the plugin’s requirements — see Install and Activate. If the site is below the minimums, upgrade the stack before continuing.

  2. Note the workspace your Lens Inject snippet is pointing at. Look at the snippet in your theme (or wherever Lens Inject is wired in) and record the workspace token or workspace identifier. You will need to connect the new plugin to the same workspace so existing feedback continues to land in the same place.

  3. Install and activate the plugin. Follow Install and Activate.

  4. Connect the plugin to the same workspace the Lens Inject snippet was pointing at — see Connect to TMXIO. For legacy installs, the Workspace token tab is usually the right choice since you already have the token in code.

  5. Configure audience, layout, and theme in the plugin to match the behavior your Lens Inject snippet was producing — see Enable Widget and Audience and Panel Layout and Theme.

  6. Verify that the widget renders on the site and that feedback submitted through the new plugin reaches the expected workspace. Use a private window to check the audience setting.

  7. Remove the Lens Inject snippet. Once the plugin is fully working, delete the hand-installed script tag or wp_footer filter from your theme. Leaving both running can cause the widget to render twice or to fight over which instance is “real”.

  8. Deploy the theme change that removes the snippet. After deploy, reload the site and confirm only one Lens widget renders.

Some sites will need to stay on Lens Inject longer — locked-down hosts, frozen themes, or contractual constraints. If that is you:

  • Document which workspace the snippet points at so the token can be rotated cleanly.
  • Add the migration to your next theme-update cycle, even if that is months out.
  • When the constraint clears, return to the migration steps above.

Support continues to answer Lens Inject questions, but new feature work targets Lens for WordPress only.