Skip to content
Sign in
Lexy
Pricing Blog Lexy Originals About FAQ Help Center
Back to Help center

Track Lexy games in your own analytics

Game starts, answers and scores as Google Tag Manager events and page events, each describing the game.

Reports
Updated November 18, 2026

Your Lexy reports show every play. If your team also measures your site in Google Tag Manager, Google Analytics or another tool, the widget can tell that tool what readers do in a game too. That covers when they start, how each answer goes, and how they finish.

It works on its own. Once the widget is on a page, it sends these events to that page.

What the widget sends

The widget sends each event in two ways at once:

  • To Google Tag Manager: a push to the page's dataLayer, under the event name in the first column.
  • As a page event: a lexy: event on the page, for your own scripts. Its name is in the second column.
Event name (Tag Manager)Page eventWhen it happens
lexy_play_clicklexy:play_clickA reader presses Play on a game card.
lexy_game_startlexy:game_startA game starts on the page, in web play or when the gated card opens.
lexy_call_startlexy:call_startA reader uses Call Now to Play and Lexy places the call. The game then carries on by phone, and its answers and score appear in your Lexy stats.
lexy_answerlexy:answerA reader answers a question, by tapping or out loud.
lexy_game_completelexy:game_completeA reader reaches the score screen.
lexy_game_exitlexy:game_exitA reader closes a game before the end.

What each event carries

Tag Manager fieldPage event fieldWhat it is
lexy_widget_idwidgetIdThe widget's number, as on My Widgets.
lexy_game_idgameIdThe game's number. The gated card's questions come from the page itself, so its events carry the page's title instead.
lexy_game_titletitleThe game's title, or the page's title on the gated card.
lexy_langlangThe game's language: en, es, tr or ar.
lexy_surfacesurfaceWhere it happened: card (a game card), modal (the game window), gated (a gated card in the article) or overlay (a gated card in the corner).
lexy_play_methodmethodonline or phone.
lexy_questionquestionWhich question, counting from 1. On lexy_game_exit, the question the reader had reached.
lexy_totaltotalHow many questions the game has.
lexy_correctcorrectOn lexy_answer: true if the answer was right.
lexy_scorescoreAnswers right so far.
lexy_percentpercentThe score as a share of the questions, 0 to 100.

Each event carries the fields that fit it, for example lexy_correct on an answer.

Every event describes the game, with its title, the question, the answer and the score.

Use them in Google Tag Manager

  1. In Tag Manager, go to Triggers and click New. Choose Custom Event.
  2. For Event name, enter one of the names above, for example lexy_game_complete. To catch every Lexy event with one trigger, enter lexy_.* and tick Use regex matching.
  3. Go to Variables, click New under User-Defined Variables and choose Data Layer Variable. Enter a field name, such as lexy_score. Make one for each field you want.
  4. Make a tag that uses the trigger, for example a Google Analytics: GA4 Event tag. Set its event name to {{Event}} and add the variables you made as parameters.
  5. Preview, play a game on your page, and check the events in the preview panel. Then publish the container.

Use them in your own scripts

Every event is also a page event, so your own code can listen to it directly:

document.addEventListener('lexy:game_complete', function (e) {
  console.log(e.detail.title, e.detail.score + ' of ' + e.detail.total);
});

Listen on document to hear every Lexy widget on the page. With more than one, e.detail.widgetId tells them apart.

Know when a gated card's questions are ready

A gated card opens its questions as the reader reads, listens or watches. Each time the number of ready questions changes, the widget tells the page with a page event named lexy:questions_ready. Use it to show your own cue, such as a "Quiz ready" badge beside the headline.

Page event fieldWhat it is
widgetIdThe widget's number, as on My Widgets.
surfacegated (a gated card in the article) or overlay (a gated card in the corner).
langThe questions' language: en, es, tr or ar.
readyHow many questions the reader can play now.
lockedHow many open later, as the reader reads, listens or watches.
totalHow many questions the card has.
document.addEventListener('lexy:questions_ready', function (e) {
  var badge = document.getElementById('quiz-badge');
  badge.textContent = e.detail.ready + ' of ' + e.detail.total + ' ready';
});

This one is sent as a page event only, so your Tag Manager event counts stay as they are. A script that loads after the widget can read the latest count from a gated card in the article: document.querySelector('lexy-widget').lexyQuestionsReady.

A widget in Overlay mode sends the same event from its corner prompt, with surface set to overlay, before the quiz is opened as well as during it.

Know when the corner prompt shows

A widget in Overlay mode puts a small Play the quiz prompt in the corner of the page, or on the video. See Float a quiz over the page or the video. The widget tells the page when the prompt appears and when it goes away, with two page events.

Page eventWhen it happens
lexy:prompt_shownThe prompt appears. It stays for the rest of the visit, so this is sent once per page view unless your own script hides and shows it.
lexy:prompt_hiddenThe prompt goes away, because your script hid it or the reader finished the quiz.
Page event fieldWhat it is
widgetIdThe widget's number, as on My Widgets.
whyOn lexy:prompt_shown, what brought the prompt up: ready (a question the reader can play), now (the page has questions), watched (the set time watched), pause (the video paused), end (the video ended) or manual (your script). On lexy:prompt_hidden: manual (your script) or complete (the quiz is finished).
readyOn lexy:prompt_shown: how many questions the reader can play now.
lockedOn lexy:prompt_shown: how many open later.
totalOn lexy:prompt_shown: how many questions the quiz has.
langThe questions' language: en, es, tr or ar.
document.addEventListener('lexy:prompt_shown', function (e) {
  console.log('Quiz prompt shown: ' + e.detail.why, e.detail.ready + ' ready');
});

These two are page events only, like lexy:questions_ready. When the reader taps Not now, the prompt folds to a small mark in the same place and stays on the page, so that sends neither event.

A script that starts listening late can read the last lexy:prompt_shown detail from the widget's tag, as lexyPrompt.

Your page can also show, hide and open the prompt itself. See Control the quiz prompt from your own page.

Send page events only

To send page events only and leave your dataLayer to your own tags, add this line to the page before the Lexy script tag:

<script>window.LexyWidget = { dataLayer: false };</script>

The page events still fire, so your own scripts keep working.

Good to know

  • Lexy's reports stand on their own. Your stats on lexy.fm are complete whatever your tags do.
  • The events are yours. What your tags do with them stays with you.
  • They follow the page. A game opened from a share link or a QR code plays on lexy.fm, and counts in your Lexy stats.