Home Guides Google Analytics

How to set up Google Analytics in a quiz

If your website already has Google Analytics
Connect the quiz to the ID of the same data stream your website uses. That way, quiz events count toward the visitor’s session on your website, along with its traffic source and UTM parameters.
Log in to Google Analytics, open “Admin” → “Data streams” and choose yours
Google Analytics “Admin” section: “Data streams”
Copy the “Measurement ID”: it looks like G-XXXXXXXXXX
Web stream details in Google Analytics: measurement ID in G-XXXXXXXXXX format
In the quiz, go to “Settings” → “Integrations” and click “Connect” on the Google Analytics card
“Settings” → “Integrations” tab: “Connect” button on the Google Analytics card
Turn on the toggle, paste the copied ID into its field and save
Without the ID in the quiz, events aren’t sent anywhere, even if Google Analytics is already on your website.
If several quizzes share one data stream, turn on “Unique goals”: the quiz number is added to the event name, for example leadforms_finish_1024.
Google Analytics settings window in LeadForms: enable toggle and ID field
How to check that it works
Open your quiz and, in Google Analytics, go to “Reports” → “Realtime”. If everything is set up correctly, you'll see yourself among the active users, and the quiz events will appear in the list.
Google Analytics reports menu: “Realtime”
How to mark quiz events as conversions
In Google Analytics reports, open “Engagement” → “Events”.
The quiz sends the events leadforms_open, leadforms_start, leadforms_stepN and leadforms_finish (with “Unique goals” on, the quiz number is added at the end). Every event carries the parameters lf_id (quiz number) and lf_name (quiz name).
If the events tab is empty, wait up to 24 hours: that is how long Google Analytics takes to collect the quiz events.
Google Analytics reports menu: “Engagement” → “Events”
FAQ
leadforms_finish: it fires when the person has submitted the form and seen the thank-you screen. If “Unique goals” is on, pick the event with the number of the quiz you need, for example leadforms_finish_1024.
Yes. The tracking code is loaded inside the quiz itself, so events are sent even when the quiz is opened without your website: from a link in social media, a newsletter or a map listing.
The preview in your dashboard does not send events to analytics. Test the published quiz instead, from its direct link or on your website.
No. LeadForms collects views, leads, conversion rate and the steps where people drop off on its own, in the “Analytics” section of your dashboard, whether or not any tracking is connected. Learn more in the guide “How to read built-in quiz analytics”.
Having trouble with the setup?
If something doesn't work, and we'll sort it out with you.

Still have questions? Write to us

Name *
* Required field
Email *
* Required field
Message
Write to us!
We reply within 30 seconds