Skip to main content

Embed Analytics in Your Google Analytics

With the script embed, what a visitor does inside the embed reaches your page's own Google Tag Manager or Google Analytics 4 as a vibemap_ event: a card click arrives as vibemap_event_selected, a ticket link as vibemap_event_link_clicked. You can report on the embed next to the rest of your site, with no Vibemap login.

What you need​

  • The script embed (load.js). A bare <iframe> can't pass events to your page: nothing on your page listens for them.
  • Google Tag Manager or gtag.js on the page that loads the script.

Inline render mode (data-render-mode="inline") runs the embed in your page instead of a frame. Its events reach your analytics the same way, under the same rules, with surface inline and embed_type inline-list or inline-single.

Where the events land​

The script picks one destination per event:

Your page runsThe script sends
Google Tag ManagerdataLayer.push({ event: "vibemap_<name>", vibemap: { ...parameters } })
gtag.js, without Tag Managergtag("event", "vibemap_<name>", { ...parameters }): straight to every GA4 property your gtag configures
Only a window.dataLayer (Tag Manager not loaded yet)The same dataLayer.push, which Tag Manager reads when it loads
NeitherNothing

The script recognizes Tag Manager by its container snippet (the gtm.start push) or a loaded GTM- container. A page with Tag Manager gets the data layer push only, even if it also defines gtag, so no event counts twice. Vibemap's own container, which the WordPress plugin loads, does not count as yours: beside gtag.js the events still go to gtag.

Before each data layer push the script sends { vibemap: null }. Tag Manager merges every push into its data model, so without the reset an event would carry an earlier event's vibemap.item_id.

Send the events to GA4 through Tag Manager​

  1. In Tag Manager, open Variables. Under User-Defined Variables, click New, choose Data Layer Variable, and set Data Layer Variable Name to vibemap.item_name. Save it as DLV - vibemap.item_name. Repeat for each parameter you want in reports, such as vibemap.item_id, vibemap.list and vibemap.embed_type.
  2. Open Triggers, click New, and choose Custom Event. Set Event name to vibemap_.* and tick Use regex matching.
  3. Open Tags, click New, and choose Google Analytics: GA4 Event. Enter your Measurement ID, set Event Name to {{Event}}, and under Event Parameters add one row per variable, for example item_name = {{DLV - vibemap.item_name}}. Set Triggering to the trigger from step 2.
  4. Click Submit to publish the container.

With gtag.js only, skip these steps: the events reach GA4 with their parameters already attached.

To see a parameter in GA4 reports, register it: in GA4 open Admin, then Custom definitions, click Create custom dimension, keep the scope Event, and enter the parameter name (item_name, list, embed_type...). Reports show a dimension only for events collected after you create it.

To check the setup, open your page in Tag Manager's Preview mode and click a card in the embed: vibemap_event_selected appears in the event list. Without Tag Manager, open GA4's Realtime report or run this in the browser console:

dataLayer.filter((e) => /^vibemap_/.test(e.event))

Turn it off​

Add data-analytics="off" to the script tag, or analytics=off to the embed URL. Either one stops the events, the corrected page view below, and the embed's own Vibemap analytics. false, 0 and no work too.

<div id="vibemap-embed"></div>
<script
src="https://web.vibemap.com/load.js"
data-iframe-el="vibemap-embed"
data-url="https://web.vibemap.com/embed/grid?list=downtown-events"
data-analytics="off"
></script>

Parameters on every event​

ParameterValue
partnerYour organization's slug, or the theme slug when the embed URL names no organization
themeThe embed's theme slug
listThe list's slug or ID, for a list embed
embed_typegrid, map-grid, carousel, single, calendar (a grid that opens on its calendar view), a form such as add-event, or inline-list and inline-single in inline mode
surfaceembed, or inline in inline mode
hostYour page's hostname
client_versionThe embed build that sent the event

A parameter the embed doesn't know is left out, not sent empty.

Events​

Each event below arrives with the vibemap_ prefix, so event_selected arrives as vibemap_event_selected. Parameters are listed without the common ones above.

EventSent when the visitorParameters
event_selectedOpens an event from a card, map pin, list row, carousel slide or calendaritem_id, item_name, source, position_in_list
place_selectedOpens a place from a card, map pin, list row or carousel slideitem_id, item_name, source, position_in_list
item_impressionsSees cards: each counts once per page view, after a second at least half on screensource, item_type, item_ids, positions, item_count
load_moreLoads more cards, with Load More or by scrolling your pagesource, items_shown, items_total, trigger
event_viewedSees an event's detailsitem_id, item_name, item_category
place_viewedSees a place's detailsitem_id, item_name, item_category
event_link_clickedFollows a ticket or event link, the embed's main conversionitem_id, item_name, item_type, outbound_host, link_type
website_clickedFollows a place's or event's website linkitem_id, item_type, item_name, url, outbound_host
social_link_clickedFollows a Facebook, Instagram or X (twitter) linkitem_id, item_type, platform
directions_clickedAsks for directionsitem_id, item_type, item_name
call_clickedClicks the phone numberitem_id, item_type, item_name
share_clickedShares an itemitem_id, item_type, share_method
save_to_calendarAdds an event to a calendaritem_id, item_name, provider
bookmark_addedSaves an itemitem_id, item_type, item_name
bookmark_removedRemoves a saved itemitem_id, item_type
recurring_view_allExpands all dates of a recurring eventitem_id, action
section_toggledOpens or closes a details sectionitem_id, section, expanded
vibes_toggledShows or hides an item's vibesitem_id, expanded
vibe_clickedClicks a vibe tagitem_id, vibe_name
category_clickedClicks a categoryitem_id, category_name, category_url
learn_more_clickedClicks Learn moreitem_id, item_type
image_gallery_viewedOpens the photo galleryitem_id, image_index
image_gallery_navigatedMoves through the galleryitem_id, direction
panel_closedCloses the details panelitem_id, item_type
tab_changedSwitches tabstab_name, previous_tab
filter_appliedApplies a filterfilter_type, filter_value
filter_clearedClears the filtersprevious_filters_count
date_range_changedPicks a date rangestart_date
view_search_resultsSearchesresults_count
map_zoomedZooms the mapzoom_level, zoom_direction
cluster_clickedClicks a cluster of map markerscluster_count, zoom_level
group_expandedExpands markers stacked at one spotgroup_count, expansion_mode
ad_clickedClicks a banner adad_slot, ad_image, ad_link
form_startedStarts a form, such as Add an eventform_type
form_submittedSubmits a formform_type, success
business_claimedClaims a businessbusiness_id, success

New events and parameters can appear as the embed grows; an existing name changes only with a changelog entry.

Which card, and where​

source says where the visitor found the item, so a click on a map pin and a click on a card are told apart:

sourceWhere
cardA card in a grid
markerA pin on the map
listA row in the list view, or the cards beside the map
carouselA carousel slide, or the swipe cards over the map on a phone
calendarAn event in the calendar

position_in_list counts from 1 in the order the visitor sees: the second card in the grid is 2. A map pin carries one only when it shows a number.

Counting cards seen​

Cards seen arrive in batches: one item_impressions event lists up to 20 cards from one list in item_ids, and item_count says how many. Count cards seen by adding up item_count, not by counting the events. In GA4, register item_count as a custom metric (Admin, Custom definitions, Custom metrics). The click-through rate of the grid is then the event_selected and place_selected events with source card, divided by the sum of item_count for source card. item_ids arrives comma-joined with as many whole ids as fit in GA4's 100 characters, and positions lists the places of those ids only, so use item_count for totals.

Ticket clicks​

event_link_clicked names where the visitor went in outbound_host (for example eventbrite.com) and which link in link_type: primary for the event's own button (Get Tickets, More Info), else the link's type, such as tickets. It never sends the link itself, whose address can carry personal details. To count ticket clicks as conversions in GA4, mark vibemap_event_link_clicked as a key event.

The corrected page view​

A single event or place embed also sends one page view titled with the item's name, so the hit doesn't carry your template's generic title. It goes to Universal Analytics (ga) or gtag as a standard page_view. A page with Tag Manager and neither ga nor gtag gets it as vibemap_page_view, with page_title, page_location and page_path at the top level of the push. The embed's own page views inside the frame are never forwarded, so a visit counts once.

What is never sent​

The script checks every event before it reaches your analytics, so a visitor's details stay out of your GA4 property whatever the embed sends:

  • No personal data or typed text. Email addresses, phone numbers, people's names, street addresses, search terms, messages and descriptions are dropped. A value that looks like an email address is dropped wherever it appears.
  • No coordinates. Latitude and longitude are dropped, since they can be the visitor's own location.
  • No query strings. A link keeps only its address up to the ?.
  • Nothing that rewrites your hit. page_location, page_title, page_referrer, send_to, user_id, client_id and session_id are dropped, so an event always counts for your page and your property.
  • GA4's limits are kept. Values are strings of up to 100 characters, numbers or booleans; a list arrives comma-joined, whole elements only. An event carries at most 25 parameters, and an embed sends at most 500 events per page load.

The script accepts events only from its own embed frame, and only while that frame shows a Vibemap page. If the visitor follows a link inside the frame to another site, that site can't send events into your analytics. Two embeds on one page never forward each other's events.