Note
These steps are for tracking events with Google Analytics 4 (GA4). If you are still using Google's Universal Analytics, please see our Track ViewMedica events with Google Universal Analytics article.
Enable tracking
Make sure you have a Google Analytics account and have the analytics tracking code installed in your HTML page that displays the ViewMedica viewer. See Google’s site for Google Analytics support.
Paste the following script into the
<head>
of your website. It is required, as it relays events from the ViewMedica iframe to the Google Analytics on your page.
<script src="https://ondemand.viewmedica.com/lib/vm.js" defer></script>
Defining ViewMedica On-Demand events in GA4
Google Analytics 4 is an event-based analytics tool where everything is an event. You may need to set up custom dimensions in GA4 to track events for individual ViewMedica On-Demand content items.
Log into your Google Analytics account.
Select your GA4 property.
On the left, click Admin. Under Property settings, look for Data display and click Custom definitions.
Click Create custom dimension.
Create the following dimensions. You may need to manually type in the value for the Event parameter.
Dimension name | Event Category | Event Label | Event Action |
Scope | Event | Event | Event |
Description | On-Demand | Video Title | Video Interactions |
Event parameter | event_category | event_label | event_action |
6. Click Save.
The events listed below are associated with ViewMedica's content items.
|
|
You may see a value of (not set) for a custom dimension for the first 48 hours.
Finding ViewMedica On-Demand events in GA4
Log into your Google Analytics account.
Select your GA4 property.
On the left, click Reports > Engagement > Events.
Click the event you want to track or create filters to show more detailed information.
Example: Tracking views for individual ViewMedica views using the "Video Started" event.