Guide for solopreneurs with a landing page
Lead tracking script: add one tag, collect every lead, no backend
A lead tracking script is one line of code you paste into the head of your landing page. It records each visit and picks up your form when someone submits it, so every lead is saved with where they came from and what they did on the page. No backend to build: with ownyourclick, leads land in your Google Sheet.
It captures forms on your own page. Forms embedded from another service, such as Google Forms or Typeform, aren't captured.What it doesn't capture →
7 days of Team, free. No card needed.
| How they arrived | Source | UTM content | Hot % | Form answers |
|---|---|---|---|---|
| Tapped the link in an Instagram reel's caption | reel-haldi-shoot | 82% | Date: 14 Feb · Venue: Chennai | |
| Searched Google and clicked the site | google · organic | — | 47% | Date: 3 Mar · Budget: ask |
| Opened the page from a WhatsApp status link | status-portfolio | 18% | Date: not sure yet |
What is a lead tracking script?
A lead tracking script is a small piece of JavaScript that runs on your website. You don't write it; the tool gives you one line that loads it, and you paste that line into your page.
Two quite different kinds go by the same name:
| Kind | What it tells you | Who it suits |
|---|---|---|
| Visitor identification | Which companies visited, guessed from the visitor's IP address. Nobody filled anything in. | B2B sales teams selling to businesses |
| Form lead tracking | Every person who filled your form, with the link, post or ad that sent them and how they behaved on the page | Anyone who gets enquiries from a landing page: coaches, consultants, photographers, clinics, people who make videos on social media, course sellers |
This guide is about the second kind. If you run one landing page and want to know who enquired, where they came from and who to call first, that's the script you need.
Why use a script tag instead of building a backend?
Without a script, catching a lead with its source usually means building the plumbing yourself:
| Way | What you have to set up | What you get |
|---|---|---|
| Build it yourself | A form that posts to your own server, a database, code that reads the UTM tags from the address and keeps them until the form is sent, and something that writes to your sheet | Exactly what you build, and you maintain it |
| Form plugin + automation tool | A form plugin, a connector to Google Sheets, hidden fields for each UTM tag | The answers in a sheet; the source only if the hidden fields work on every page |
| One script tag | Paste one line into <head> | Every form fill with its source, UTM tags, hot % and form answers, in your Google Sheet and the Leads tab |
For a solopreneur the script is the short way: your page stays on WordPress, Webflow, Framer or plain HTML as it is, your form stays as it is, and there's no server to keep running.
How do you add the lead tracking script to your page?
- Add your page. In ownyourclick, open Pages → Add page, paste the page's address (the one with your form), give it a name and press Create page. It opens on its Settings tab.
- Copy the tag from the Settings tab. It carries your page's id and looks like this:
<script async src="https://go.ownyourclick.com/oyc.js?p=YOUR_PAGE_ID" data-form="form"></script>- Paste it into the page's
<head>and publish:
| Website builder | Where it goes |
|---|---|
| Plain HTML | Inside <head> of the landing page |
| WordPress | A header-code plugin, or your theme's header settings |
| Webflow | Page settings → Custom code → Inside <head> tag |
| Framer | Site or page settings → Custom code → End of <head> |
| Next.js | The <Script> component from next/script, in app/layout.tsx or pages/_app.tsx |
| React (Vite, Create React App) | index.html (Vite) or public/index.html, inside <head> |
- Send a test lead. Open your page in a private window, fill the form and submit it. The Setup status checklist on the Settings tab ticks itself: "Script detected on your page", "First visit recorded", "First lead received".
- Connect your sheet. On Configure Sheets, press Connect Google and create my sheet. Every lead is written to it from then on.
That's the whole setup. If you'd rather watch it, the 3:50 video shows each step.
Which forms does the script capture?
data-form="form"captures every form on the page. To capture only one (say the page also has a newsletter box), give that form an id and use it:data-form="#lead-form".- A form counts when it's submitted and passes its own checks, such as required fields. A Submit press that fails isn't a lead. The same answers sent twice within 5 seconds count once.
- Forms your site builder adds after the page loads (pop-ups, sliding panels) are caught too: the script listens on the whole page, not on one form.
- Field names come from each field's name, id, label or placeholder, so a phone box without a name still arrives as a column. Passwords and card numbers are never sent.
- Answers that aren't form fields, such as cards people tap: mark them with
data-oyc-field="Package"anddata-oyc-value="Full day". - Multi-step forms built in JavaScript: remove
data-formfrom the tag and send the lead once, when it's complete:
<script>
oyc('submit', { name: nameValue, email: emailValue, phone: phoneValue });
</script>What does each lead come with?
Each lead is a row in your Google Sheet and on the page's Leads tab, with:
- Where they came from. The source of the link they used (one version of your link per place you post), or the UTM tags on the address (
utm_source, campaign, medium, content, term). A visit with no tagged link still gets a source from the site that sent it: Google as organic, Instagram as social, any other site as referral, nothing as Direct. - How they behaved. Time actively on the page (a hidden tab or an idle visitor doesn't count), how far they scrolled, what they clicked and their visit number. Together they make the hot %, so you call the ready ones first.
- What they told you. Every answer in your form, as its own column.
- Where they are. Country, city and device.
- The payment, when they pay, matched from your thank-you page or straight from Dodo Payments, Razorpay or Stripe (payment tracking).
Calling with this in front of you changes the call: you know it was the Instagram reel, you know they came back three times and scrolled to the end, and you can open with that instead of "So, what are you looking for?".
The script also keeps Meta's click id from an ad, so if you connect the Meta ads tab, your leads and purchases go back to Meta. See the Meta Pixel lead tracking guide.
Where do the leads go, and what if your Google Sheet is deleted?
Every lead is saved in ownyourclick (the page's Leads tab) and written to your Google Sheet. With a sheet connected through Connect Google, what you change in Status, Tags and Notes in the sheet comes back to ownyourclick within about 30 seconds. More on that in Google Sheets CRM.
Because the leads live in ownyourclick as well as the sheet:
- If the sheet is deleted or moved to the bin, the Configure Sheets tab says so. Restore it from Google Drive, or create a new sheet there, then use More → Copy existing leads to bring the earlier leads across. Leads already in the sheet aren't doubled.
- If some leads didn't reach the sheet, the tab shows how many, and Resend sends them.
- Export CSV on the Leads tab downloads the leads the current filters show.
- If a trial or plan ends, pages keep collecting leads and nothing is deleted; leads aren't sent to the sheet until a plan is picked, and then Resend sends them.
What doesn't the script capture?
- Forms embedded from another service, such as Google Forms, Typeform, HubSpot or Jotform boxes. The form lives on their site, not yours, so the script can't see it. Use a form on your own page, or an ownyourclick lead form (Create Form).
- Facebook and Instagram instant forms (lead ads that stay inside Facebook). Nobody visits your page. Send the ad to your landing page instead.
- Other websites. The tag only tracks on the domain you set the page up with, so a copy pasted on another site does nothing.
- Private browsing modes that block storage. Otherwise every page load would look like a new person.
And if the Setup status checklist doesn't tick: check the tag is inside <head> on the published page (not only in a draft), clear your site's cache if it has one, and make sure a "delay JavaScript" or script-removing setting in a speed plugin isn't holding the tag back.
ownyourclick is lead tracking and a Google Sheets CRM. It has no dialer and no call recording, and it doesn't import ad spend.
Questions
What do people ask?
Do I need a developer to add a lead tracking script?+
No. You copy one line from your page's Settings tab in ownyourclick and paste it into the page's <head>, the same place your website builder takes any header code. Only a multi-step JavaScript form needs one extra line of code.
Should the tracking script go in the head or the body?+
In the <head>, so it loads as soon as the page does and sees every visit. On Next.js, use the Script component from next/script in your layout file instead.
Will a tracking script slow down my landing page?+
The ownyourclick tag loads with the async attribute, so the browser keeps showing your page while the script downloads instead of waiting for it.
Does it work with WordPress, Webflow and Framer forms?+
Yes, for forms on your own page. Paste the tag in the builder's header code setting and every form on the page is captured. Forms embedded from Google Forms, Typeform, HubSpot or Jotform aren't.
Does the script use third-party cookies?+
No. It's first-party, with no third-party cookies and no fingerprinting. The click id travels from your link to your page in the address, so each lead is tied to the click and source that brought it.
How do I know the lead tracking script is working?+
Open your page in a private window and submit a test lead. The Setup status checklist on the page's Settings tab ticks Script detected on your page, First visit recorded and First lead received within a few seconds.
Can I try it before paying?+
Yes. Every account starts with 7 days of the Team plan, free, with no card. If you don't pick a plan, your page keeps collecting leads and nothing is deleted.
Was this page helpful?
Thanks, that helps us make this page better.
What to read next?
Form to Google Sheets →
Send a website form to your own Google Sheet with its UTM source and a hot %. Works on WordPress, Webflow, Framer and HTML.
Google Sheets CRM →
A Google Sheets CRM that fills itself: every landing page lead as a row with its UTM source and hot %, plus a free Sheets/Excel template.
UTM builder →
A free UTM link builder with presets for Facebook, Instagram and Google ads, WhatsApp and YouTube. No sign-up needed.
Meta Pixel lead tracking →
Make Meta count the leads you really got: Lead only when the form saves, once per person, pixel plus Conversions API deduped, and purchases sent too.
Lead scoring →
Lead scoring from behaviour: a hot % for every lead from time on page, scroll, clicks and visits, so your team calls the ready ones first.
The tracking code →
Every option of the tag: which forms it captures, oyc('submit') for JavaScript forms, and what it records.
Paste one tag and get your first lead today
7 days of the Team plan, free. No card needed. Then from ₹699 a month.