In short
How do you count leads from an embedded website form as conversions in Google Analytics 4?
Connect Qualiform to Google Analytics two ways on the same property: from Qualiform's server with an API secret, and from your own page with a browser tag. Each finished conversation is then counted once as a generate_lead event, credited to the visit that brought the visitor. Mark generate_lead as a key event in Google Analytics and it counts as a conversion.
On this page
- What do you need before you start?
- Why connect Google Analytics two ways?
- How do you find your Measurement ID and API secret?
- How do you connect the server side?
- How do you connect the browser tag, and what changes on your site?
- How do you test the server side?
- How do you test the browser tag?
- What counts as a finished conversation?
- How do you mark generate_lead as a key event?
- How do you report on lead score, priority, and routing rule?
- What does Qualiform never send to Google Analytics?
- What are the limits?
Counting a website form lead as a conversion in Google Analytics takes two settings, one in Qualiform and one in Google. In Qualiform, you connect Google Analytics so each finished conversation sends a lead event. In Google Analytics, you mark that event as a key event, which is Google's current name for a conversion. These steps work for anyone with a Qualiform form and a Google Analytics 4 property.
Qualiform names the event generate_lead. That is the name Google recommends for the moment a visitor submits a form or asks for information.
What do you need before you start?
You need four things:
- A Google Analytics 4 property with a web data stream. You need Editor access or above on the property to see the Measurement ID. Google's help says so. Editing key events needs the Marketer role or above.
- An Admin in Qualiform. Only Admins connect tools.
- A live form on your own site, if you want the browser tag. The pill in the form header must say active.
- The ability to edit the page the form sits on. Adding the browser tag means pasting one more line of code there.
Both connections are on every Qualiform plan, Free included. No plan gates them.
Why connect Google Analytics two ways?
Qualiform offers two connections on the Integrations page. You can use either one, or both. Using both on the same property is the one I recommend.
| Server side | Browser tag | |
|---|---|---|
| What it is | Qualiform's server sends the event to Google | A line on your page sends it from the visitor's browser |
| Needs | Measurement ID and API secret | Measurement ID only |
| Counts on the form's direct link | Yes | No |
| Counts when a visitor blocks ads | Yes | No |
| Credited to the visit and the ad that brought the visitor | No, each lead is its own user | Yes |
| Sends the lead score | Yes | No |
Each one fills the other's gap. The server side never misses a finished conversation, but it was not there when the visitor clicked your ad, so it cannot say where they came from. The browser tag was there for the visit, but a blocked tag, or a visit to the direct link, leaves it blind. The post on why Google Analytics misses leads from an embedded form explains the reasons.
With both connected to the same property, Qualiform does not count a lead twice. Google Analytics does not merge duplicate generate_lead events, so two senders would double every lead. To prevent that, the browser tag reads the visitor's Google Analytics IDs on your page and hands them to the form. The server then sends the one conversion with those IDs, and the browser tag sends nothing of its own for that property. The lead is counted once and credited to the visit and the ad or page that brought the visitor. If the visitor blocks Google Analytics, the server still counts the lead. It then counts as its own user, without the visit.
How do you find your Measurement ID and API secret?
Both come from the same place in Google Analytics. These are the clicks from Google's help on finding your Measurement ID:
- Open Admin.
- Under Data collection and modification, click Data streams.
- Pick the Web tab, then click your web data stream.
- Copy the Measurement ID from the first row. It starts with
G-.
For the API secret, stay on that same data stream page. Google's Measurement Protocol guide puts it under Measurement Protocol API secrets:
- Find Measurement Protocol API secrets.
- Click Create.
- Copy the Secret value.
Treat the secret like a password. Google says it must not be exposed in client-side code. Qualiform keeps it on its server, stores it encrypted, and never shows it again after you save it.
How do you connect the server side?
- In the Qualiform app, open the Integrations page and click Google Analytics (server side).
- Press Connect.
- Paste the Measurement ID and the API secret.
- Press Connect again to save it.
By default a connection serves every form, including forms you make later. To limit it, press Choose forms and pick the forms you want.
Do not skip the test below. Google accepts a request with a wrong API secret and then drops the event without a word. A connection that looks fine can count nothing.
How do you connect the browser tag, and what changes on your site?
The browser tag needs only the Measurement ID, but it also needs a change on your site. The change is a third line of code.
- In Qualiform, open Integrations and click Google Analytics (browser tag).
- Press Connect, paste the same Measurement ID you used for the server side, and press Connect again.
- Open the form and go to its Embed tab. The code there now has three lines instead of two: the frame,
embed.js, and the tag. - Press Copy code, and replace the old code on your site with it.
The connection's window on the Integrations page says the same, with a link to each form's Embed tab: "Your form's code has one more line now. Copy it again from the Embed tab and replace it on your site."
Three notes on that code:
- Keep all three lines, and put them in the body of the page, in the HTML, not in the head.
- The tag has a line of its own on purpose. If your site has a cookie banner, it can hold that line back until a visitor agrees, like any other analytics tag.
- It runs on your page, not inside the form. A Google Analytics tag inside a frame is a different page on a different site, without your site's cookie, so it would count the visitor as a second person. That is why Qualiform's tag runs on your own page.
You can reach the same code from the Instructions for an AI choice on the Embed tab, which includes the tag line when the browser tag serves that form.
How do you test the server side?
- On the Google Analytics (server side) connection, press Send a test.
- Qualiform first has Google check the format of a test event. Then it sends a real test event named
qualiform_test. - In Google Analytics, open Reports, then Realtime.
- Look for
qualiform_testunder Event count by Event name.
The message in the app says it shows up within a minute. Google describes Realtime as the last 30 minutes of activity, updated by the minute.
If qualiform_test does not show up, the Measurement ID or the API secret is wrong. Qualiform sends a real event on purpose. Google's own format check does not check the API secret, so the only proof the secret works is the event arriving in Realtime.
Preview sends nothing to any connection, Google Analytics included. A real test of a lead means a real conversation on your live form.
How do you test the browser tag?
The browser tag has no Send a test button. Test it with a real conversation:
- Open the page on your own site that holds the form.
- Finish a conversation, any way it can end.
- In Google Analytics, open Reports, then Realtime, and look for
generate_leadunder Event count by Event name.
If your cookie banner holds the tag's line back, accept analytics first. If you have both connections on, a wrong API secret means the lead is not counted on that property at all, because the tag stays quiet for it. That is another reason to run Send a test first.
What counts as a finished conversation?
Qualiform sends one generate_lead event for each conversation that ends. A conversation ends when:
- the AI signs off once it has what it needs,
- a rule turns the visitor away,
- the conversation reaches its limit of turns, or
- the visitor gives no usable answers after several messages.
A visitor who leaves halfway sends nothing to Google Analytics. That lead is still saved in Qualiform. The event carries the time the conversation finished.
How do you mark generate_lead as a key event?
Google Analytics does not treat an event as a conversion until you tell it to. Google calls that a key event. These are the clicks from Google's help on key events:
- Open Admin.
- Under Data display, click Events.
- On the Recent events tab, find
generate_lead. - Click the star next to it.
The event has to have arrived first. If generate_lead is not in the list, finish a conversation on your live form and check again after a few minutes.
Google says a key event can take up to 24 hours to show in standard reports, though Realtime updates in minutes. Marking an event affects reports from that moment on. It does not change old data, so mark it before your first real leads, not after.
Once marked, generate_lead counts as a conversion in your reports, and in Google Ads if you link the property.
How do you report on lead score, priority, and routing rule?
The server side sends three extra details with each event. They are lead_score (0 to 100), lead_band (the priority, such as hot), and lead_tier (which routing rule the lead landed on). Google Analytics ignores a custom detail until you register it as a custom dimension. Register all three. Here are the clicks from Google's help on creating event-scoped custom dimensions:
- Open Admin.
- Under Data display, click Custom definitions.
- On the Custom dimensions tab, click Create custom dimensions.
- Type a Dimension name, such as "Lead band."
- Set Scope to Event. It cannot be changed after you save.
- Under Event parameter, type the name exactly:
lead_band. - Click Save.
Repeat for lead_score and lead_tier. A standard property can hold up to 50 event-scoped custom dimensions, so three is no strain.
Two things to know:
- Data starts from the day you create a dimension. Nothing before that day gets the detail. Create all three before your first real leads.
- Google says to allow 24 to 48 hours before a new dimension is available in reports and explorations.
Then build a view in Explore. Choose the Free form template, add lead_band as a dimension, drag it to Rows, and add the key event count as a metric. You see how many leads each priority brings. Add a source dimension, such as session source or campaign, to see which ad brings the good ones. The post on tracking lead quality, not just lead count covers how to read that view.
One caution: the score is a number from 0 to 100. Use lead_band for groups, because a table with a hundred different scores is hard to read. Keep lead_score for averages.
What does Qualiform never send to Google Analytics?
Here is what each connection sends with each generate_lead event:
| Detail | Server side | Browser tag |
|---|---|---|
lead_score |
Yes | No |
lead_band |
Yes | No |
lead_tier |
Yes | No |
form_name |
Yes | No |
form_id |
Yes | Yes |
currency (USD) and value (0) |
Yes | Yes |
Neither connection sends the visitor's answers, name, email address, phone number, or anything they typed.
The browser tag does not send the score. The browser is the visitor's own, and Qualiform never shows a visitor their score. The value is always 0.
What are the limits?
Here are the honest ones:
- The browser tag needs the form embedded on your site. The direct link and QR codes count through the server side only. They are counted, but not tied to a visit or ad.
- A visitor who blocks Google Analytics is still counted, through the server side. They show up as their own user, without the visit.
- Google takes server events up to 72 hours old. Each lead's event carries the time its conversation finished.
- Standard reports lag. Realtime shows an event within about a minute. Reports take longer, and Google's help says new custom dimensions can take 24 to 48 hours.
- Dimensions and key events are not retroactive. Set them up first.
- A wrong API secret fails quietly. Google does not return an error for it. Send a test is how you catch it.
To check it all again later, finish one conversation on the live form. Then look in Realtime for generate_lead, and a day later look for the lead in your key event report, split by lead_band.
Common questions
Does Qualiform send the visitor's answers to Google Analytics?
No. Google Analytics never receives the visitor's answers, name, email, phone number, or anything they typed. The server side sends the score, the priority, the routing rule, the form's name and ID, and a value of 0. The browser tag sends only the form's ID and a value of 0.
Do you need both connections?
No. Either one works alone, and neither is limited by plan. The server side counts every finished conversation, including on the form's direct link, but cannot tie it to a visit or ad. The browser tag ties it to the visit but only counts on your own site. Together on one property, each lead is counted once and credited to the visit.
Why does a lead show in Qualiform but not in Google Analytics?
The most likely reason is that the visitor left halfway. Qualiform saves that lead, but sends nothing to Google Analytics until a conversation finishes. The other reasons are a wrong API secret, or a custom dimension or key event created after the lead came in.
Does Preview send anything to Google Analytics?
No. Preview sends nothing to any connection. To see a real lead arrive, finish a conversation on the live form.