Tag Manager

Load the Raffle widget with Google Tag Manager, and send the widget’s events to Google Tag Manager or Tealium.

Load the Raffle widget with GTM

Create a new tag of type Custom HTML, with your preferred trigger. As the content of the tag, paste the script from your widget’s Install dialog in the Raffle app (see Install). If you show several widgets on the same page, list all their UIDs in one script; see Multiple widgets.

Then assign a trigger to the tag, so the widget loads on the pages where you want it, while respecting your visitors’ cookie choices. Use one of the Page View triggers: Consent Initialization, Initialization, Page View, DOM Ready or Window Loaded.

Once the widget has loaded, it sends its events to Tag Manager, as described below.

If your site sends a Content Security Policy, see Content Security Policy for the hosts and directives Raffle needs.

Google Tag Manager custom HTML tag configuration for loading the Raffle widget

Events sent to Google Tag Manager and Tealium

When the page has a Google Tag Manager dataLayer, the widget pushes its events to it. When the page has Tealium (utag), the widget sends the same events with utag.link, as tealium_event. The widget doesn’t change your own events; it adds its own, each prefixed with raffle_ so you can tell them apart.

Event When it’s sent
raffle_open The widget was opened
raffle_close The widget was closed
raffle_search A search was made. The event includes the visitor’s search query as value.
raffle_answer_click A visitor expanded an instant answer
raffle_click_additional_content A visitor opened the additional content of an instant answer
raffle_open_original_answer A visitor opened a page from the results or from a chat answer’s sources
raffle_view_customer_service A visitor opened the support page
raffle_select_support_channel_[channel] A visitor chose a support channel: phone, email, chat or iframe (the contact form)

raffle_search is the only event that carries data: the text the visitor searched for. The other events carry only their name. Events aren’t sent while the page is in a background tab.

Set up Google Tag Manager to register the events

If you already use Google Tag Manager, it only takes a couple of minutes to register the Raffle events.

Create a trigger of type Custom Event, enter raffle_ as the Event name, and tick Use regex matching. Leave the rest as it is and save the trigger. Then add the trigger to your tag.

To use the search query of raffle_search, create a Data Layer Variable named value.

Create trigger

Creating a Custom Event trigger in Google Tag Manager with raffle_ prefix and regex matching enabled

Add trigger to selected tag

Select a tag, and choose the Custom Event you created as its firing trigger.

Adding the Raffle Custom Event trigger as the firing trigger for a tag in Google Tag Manager

The Raffle events then show up in your GA4 Analytics dashboard.

Raffle custom events appearing in the GA4 Analytics Dashboard