Google Analytics

If you want to track page views or events from your embedded Riddle, you need to listen to events sent out by the Riddle iframe and then trigger Google Analytics events accordingly.

Set up Google Analytics

Here's a guide on setting up Google Analytics.

Enable Google Analytics

  1. In your Riddle, go to PUBLISH.
  2. Go to Tracking.
  3. Enable Google Analytics 4.
    enable ga4
  4. If you have your own custom Objectname, enable Custom Google Analytics configuration and change the default from "gtag" to whatever you are using. Please make sure to only change this if you know what you are doing.
    custom ga config
  5. If you only want to track certain events, open Custom event configuration and uncheck events that you do not want to track. The default setting is that all Riddle events except "Send form data" are sent to Google Analytics.
    ga4 custom event config
  6. Click on SAVE.

This is the default event we send to Google Analytics if you are using Universal Analytics:

window.dataLayer

dataLayer.push({
    eventCategory: riddleEvent.category,
    eventAction: riddleEvent.action,
    eventName: riddleEvent.name
});

Note: If you are still using the old and outdated Google ga Tag for Analytics, please enable Google Universal Analytics (deprecated) tracking. This is the default event we send to Google Analytics if you are using the deprecated Google Universal Analytics:

window.ga

ga(
    "send",
    "event",
    [riddleEvent.category],
    [riddleEvent.action],
    [riddleEvent.name]
);