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
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.
dataLayer
utag
utag.link
tealium_event
raffle_
raffle_open
raffle_close
raffle_search
value
raffle_answer_click
raffle_click_additional_content
raffle_open_original_answer
raffle_view_customer_service
raffle_select_support_channel_[channel]
phone
email
chat
iframe
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.
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.
Creating a Custom Event trigger in Google Tag Manager with raffle_ prefix and regex matching enabled
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
Zendesk