Track Riddle Lead Gen with Google Analytics

Is getting leads your number one goal for your quiz? Pastafun is showing you a tasty way to track lead form completion with Google Analytics. All it takes is:

  • A Google Analytics account (well obviously… )
  • A secure server for your website (meaning an https:// domain instead of just http://). Sorry, no way around that
  • A Riddle with Lead Gen enabled

Imagine you are running a campaign for a client that involves a Riddle quiz to collect leads. You need to provide detailed reporting including things like geographic data of who completed the lead form. As long as you are using the built in lead generation form in Riddle and not our AWeber or MailChimp integration, you can use our custom tracking pixel field to get this done.

Here is how you do it:

  • Go to Google Analytics and grab you tracking code for your domain
  • Create a new blank HTML page and add that tracking code
  • Add event tracking to the code to make sure that you can actually find the Riddle lead gen event in Google Analytics without any trouble.
  • Save that file on the same Domain that your Riddle is running on (make sure it is https://)
  • Enter the URL of that new html page into the Custom Tracking Pixel field on the Riddle lead gen page.

That is all. As soon as the form is filled out, Google will register the event.

Below is some sample code. Please note the added event tracking code starting at line 8 below (ga: (‘send’,{hitType:event…..}:

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-YOURADSENSE-ID', 'auto');
ga('send', 'pageview');
ga('send', {
hitType: 'event',
eventCategory: 'RiddleQuiz',
eventAction: 'Leadgen',
eventLabel: 'ClientABC'
});
</script>

The key is to add the appropriate eventCategory, Action and Label tags to make the event show up in Google Analytics as shown in the screenshot below.

Track lead gen form completion in Riddle with Google Analytics

Track lead gen form completion in Riddle with Google Analytics