Skip to content

Load the data-driven beacon and move indexKey to the head - #23

Open
rheav wants to merge 1 commit into
mainfrom
install-tis-threads-beacon
Open

Load the data-driven beacon and move indexKey to the head#23
rheav wants to merge 1 commit into
mainfrom
install-tis-threads-beacon

Conversation

@rheav

@rheav rheav commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

What was wrong

public/index.html loaded integration-sandbox_iRpDiA.js, a legacy beacon with a different hardcoded API key that tracks through CSS selectors instead of data-cnstrc-* attributes. The tag had no defer and sat after </body>.

window.cnstrc.indexKey was set in src/index.jsx, so beacon config lived in the React bundle. Nothing in the app read it: the JS client gets its key from the ConstructorIOClient constructor in src/app/cioClient.js.

What changed

Removed the legacy tag. Added to the <head> of public/index.html:

<script>
  window.cnstrc = window.cnstrc || {};
  window.cnstrc.indexKey = "key_x6UnCVRZaJgIHFQD"; // Tiku's Threads
</script>
<script defer src="https://cnstrc.com/js/cust/tis-threads_62j26k.js"></script>

Removed the three window.cnstrc lines from src/index.jsx. The inline script runs during parsing, so the key is set before the deferred beacon executes.

Placement follows Direct site placement.

Replaces the legacy integration-sandbox beacon with the DDB bundle built
for this site, and moves window.cnstrc.indexKey out of the React bundle
into the document head, so the beacon no longer depends on application
code having executed.
@rheav
rheav requested review from a team as code owners August 29, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant