<script>
tag that tracks all form interactions β including abandoned fields. You donβt need to modify your form structure or write any special handlers.
π¦ Where to add the script
In most React apps created with Create React App (CRA), the best place to add the Trakg script is inside thepublic/index.html
file.
β Recommended placement
Paste the following line before the closing</body>
tag inside public/index.html
:
YOUR_ID_GIVEN
with the unique Site ID from your Trakg dashboard.
π Full Example: public/index.html
π‘ Best Practices
β Always use thedefer
attribute β it ensures the script loads after HTML is parsedβ Keep the script at the end of the
<body>
for non-blocking performanceβ No need to wrap your form with providers or HOCs β Trakg works with standard HTML form tags
β Works with any form built using
form
, input
, textarea
, or select
π Youβre Ready!
Once installed, visit your Trakg dashboard to:- View partial and completed leads
- See real-time form activity
- Export your lead data anytime