Install GeoEngage on React
Add the GeoEngage tag to the index.html of a React app built with Vite or Create React App. Route changes are detected.
A single-page React app serves every route from one HTML file. The tag goes in that file's <head>.
Add the tag
-
Open the index.html your build serves:
- Vite:
index.html in the project root
- Create React App:
public/index.html
-
Paste the tag inside <head>, above your app's own <script>:
<!-- GeoEngage — place in <head>, above your content.
Do not add async/defer: the widget must run before the page paints. -->
<script
src="https://cdn.geoengage.app/ge.js"
data-api-key="YOUR_API_KEY"
data-require-consent="false"
></script>
-
Build and deploy. From then on, rules change from the dashboard without a rebuild.
Routing
React Router, TanStack Router and most other routers change the URL through the History API, which the widget follows. Nothing to set up. If yours works differently, see Single-page apps.
Using Next.js? See Install on Next.js.
Check it's working
Deploy, open your site in a private window, then follow the checks.