- Print
- DarkLight
- PDF
[GA4] Set up analytics for your site and apps
This article explains how to set up your site and apps to push events to your Google Analytics 4 (GA4) account. ViewLift will implement the integration of your website and apps with GA4 streams. Once the integration is complete, you will start seeing the standard and custom events in the respective GA4 data streams.
Prerequisites
- Your GA4 streams are created.
- "GA4 measurement ID" (aka properties) and "API secret key" are created and shared with ViewLIft.
Integration process
- Create your GA4 accounts for web, mobile apps, and OTT.
- Link your GA4 Measurement ID with Tools Platform. To find a GA4 Measurement ID, from your Google Analytics account, navigate to Admin > Data Streams and copy the data stream to the link.
- To link the Measurement ID, from your ViewLift Tools account, navigate to AppCMS > Settings > Analytics section, and add the Measurement ID in the GA4 Tracking ID field for each device platform, then click Save > Publish.
- Identify and verify existing custom events and parameters used in Universal Analytics.
- Configure the same custom events and parameters directly in the website and apps' code for GA4 events tracking.NoteTo improve the performance of our website and apps, we have opted to implement Google Analytics 4 (GA4) events directly into our platform code. This eliminates the need for Google Tag Manager (GTM), which can add latency to page load times.
- Configure GA4 data streams.
- Activate Google Signals for cross-device tracking.
- Register custom parameters for custom events and test GA4 implementation in parallel with Universal Analytics.
- Wait for the ViewLift development teams to complete the integration.
GA3 to GA4: Key differences
Google Analytics 4 uses the same event model as Universal Analytics. This means that you can use the same events and event parameters in GA4 as you did in Universal Analytics. Also, in GA4, you can target events to specific pages or screens. This is the same as Universal Analytics.
Even with these similarities, some characteristics are different, as explained below.
GA3 (Universal Analytics) | GA4 | |
---|---|---|
Sessions (Hits Vs Events) | A session is based on hits. | A session is based on events for a given time period. GA4 uses shorter session timeouts (5 minutes) than GA3 (30 minutes). This makes sessions more meaningful and accurate to track user journeys. |
Active users | User activity is reported when a user visits a page or performs an action on a page. | User activity is reported automatically. This means that GA4 may report higher active user counts than GA3. |
Views | Web and app tracking was based on views. GA3 is like a guestbook. Every time someone visits, you will make an entry. | Works on the logic of data stream. Data streaming works by continuously capturing, processing, and delivering data in real-time as it is generated. GA4 is like a video camera. It records everything that happens on your website or app. You can then go back and watch the video to see what people did. |
Event tracking | GA3 events have a specific format called the “category-action-label-value” schema. This means that every event must have a category, an action, a label, and a value. For example, an event for a user clicking on a button might have the category “button,” the action “click,” the label “submit,” and the value “1.” | No required schema; events can have customizable parameters. GA4 has four event categories:
|
Ecommerce tracking | Powerful ecommerce tracking capabilities. | Ecommerce tracking capabilities still in infancy; no enhanced ecommerce tracking available. |
Attribution modelling | Powerful multi-channel funnels attribution reports. | Few attribution modelling capabilities exist. |
Custom dimensions | Can set/change scope to 'Hit', 'Session', 'User', or 'Product'. | Replaced 'Hit' and 'Session' scopes with 'event' scope; can create custom dimension with 'event' or 'user' scope. |
Custom metrics | Can set/change scope to 'Hit' or 'Product'. | No scope changes available; custom metric has only 'event' scope. |
Engagement metrics | Uses pageviews and bounce rate metrics. | Provides more accurate engagement metrics. These metrics include:
|
ViewLift custom events in GA4 (web)
Following are the custom events that are being sent to GA4 for the Web platform.
Description of the metrics
Event Count - number of times an event is triggered. Events can be anything from clicking a button to watching a video. The event count is updated in real time, so you can see how users are interacting with your website and apps as they are using them.
Total users - number of unique users who triggered any event in the specified date range - identified by their unique identifier e.g. cookie, user_id, etc.
Event count per user - the average number of times an event has been triggered per user.
Event name | Fired when the user... |
---|---|
epgProgram | Lands on a fast channel and the EPG loads. |
View Plans | Lands on the View Plans page. User's device info will also be passed as part of the event. |
impression | Views (impressions) received for the View Plans page. |
Player BitRate Changed | A change in bitrate occurs. The event also tracks additional information about the user's activity, including the quality of the video being watched and the source from which the video is being watched. |
user | Inputs an email address on a free plan content page and gives opt-in consent for emails. |
Carousel | Engages with content in the Carousel tray. |
Hidden View Plans mitvplans | Opens a refer and earn plan page on MiTV. |
data.title | Clicks on a recommendation tray. The name of the recommendation tray is also tracked. |
isRecommendation | Opens a video page from a recommendation tray. |
Selected a reason | Selects a reason from the subscription cancellation reason drop-down, an event is triggered. This event records the reason for cancellation and the user's unique user ID. |
Added to Watchlist | Adds a video to their watchlist on the web/apps/TV. The video info is captured too. |
ec:addImpression | Views a plan page. It tracks when a plan is selected, the currency code, plan product info, and so on. |
Recaptcha Action | Tracks the score of a user's Recaptcha action, which determines the legitimacy of user actions and potentially takes appropriate actions based on the score. |
playVideo | Clicks on a video, and the event passes the title and unique ID of the video being played. |
trackFunnel | Triggered to track the purchase journey on View Plans page. |
Customer initiated the subscription plan | Equivalent to check out. |
viewplans --> planSelected | Selects a plan from the Plans page. |
viewplans --> planSelected --> createAccount | Selects a plan and lands on the Create Account page. |
viewplans --> planSelected --> createAccount --> addBilling | Is at the checkout page. |
-- viewplans --> planSelected --> createAccount --> addBilling --> ftStart | ftStart event is a custom event that is used to track the start of a flow in a workflow. |
-- viewplans --> planSelected --> createAccount --> addBilling --> ftStart -- eventName = 'Subscription success' -- subscriptionStatus = 'Subscription failed' OR 'Subscription pending' OR 'Subscription success'" | Subscription success - Fired when a user successfully completes a payment for a subscription. This event includes the following parameters -
|
How to view data for platforms in GA4/Firebase Analytics Dashboard
When you integrate your GA4 datastream with your Firebase database, all your Firebase data is automatically synced with GA4. This means can view the app data under the Firebase section within the GA4 environment.
You can build a comparison as illustrated here to view metrics for the desired platform, Apple TV in this example. To do this, in your Firebase or GA4 Analytics Dashboard, click Add comparison. In the Build comparison menu on the RHS, click Dimension and select Source (it may be Platform Name / Platform for some GA4 properties) from the Match Type dropdown menu, select exactly matches, and in the Value drop-down, choose a platform, for example, Apple TV.
On Firebase
On GA4
ViewLift/GA4 events for Samsung TV, LG TV, Vizio, Xbox
Event name | This event is fired when... | Event Parameters |
---|---|---|
removed_from_queue | A video is removed from the queue. | eventCategory, platform, appName, appVersion, os_version, screen_resolution, site, userAgent, device_source
|
added_to_queue | A video is added to the queue. |
|
added_to_watchlist | A video is added to the watchlist. |
|
removed_all_from_watchlist | All videos are removed from the watchlist. |
|
page_viewed | A page is viewed. |
|
searched | A search is performed. |
|
ViewLift/GA4 events for ROKU
Event name | This event is fired when... | Event Parameters |
---|---|---|
page_view | User views a screen. |
|
play-video | User starts playing a video. |
|
add_to_cart | User adds an item to their cart. |
|
purchase | User makes a purchase. |
|
ViewLift/GA4 events for iOS, Android, Android TV & Fire TV
Note:
Purchase events track all purchases made across both web and app platforms. In-app purchase events specifically track purchases made within mobile apps using the app store's payment system (Google Play or Apple App Store).
Event name | This event is fired when a user... | Parameters |
---|---|---|
add_to_cart | Adds an item to their cart. |
|
begin_checkout | Lands on the "Checkout" page. |
|
screen_view | Views a screen. |
|
search | Performs a search. |
|
view_item | Views an item. |
|
tray_event | Interacts with the tray, such as by opening or closing it. |
|
success_subscription | Successfully subscribes to a service. |
|
login | Logs in to the app. |
|
logout | Signs out of the app. |
|
MVPD_Selected | Selects an MVPD (multimedia video programming distributor) provider. Example, Comcast, DirecTV, Hulu. |
|
MVPD_Provider_Page | Views the page for an MVPD provider | (No parameters) |
purchase | Trigger purchase events for any payment method, including third-party gateways like Stripe or PayPal. |
|
sign_up | Signs up for a service. |
|
tvod_purchase_completion | Completes the purchase of a TVOD (transactional video on demand) content. |
|
cancel_subscription | Cancels their subscription to a service. |
|
sign_out | Signs out of the app. |
|
like_dislike_video | Likes or dislikes a video. | (No parameters) |
tray_event | Interacts with the tray, such as by opening or closing it. |
|
program_start | Starts watching a program. |
|
stream_start | Starts streaming a video. |
|
stream_25_pct | Streamed 25% of a video. |
|
stream_50_pct | Streamed 50% of a video. |
|
stream_75_pct | Streamed 75% of a video. |
|
stream_95_pct | Streamed 95% of a video. |
|
stream_100_pct | Streamed 100% of a video. |
|
ecommerce_purchase | Makes an ecommerce purchase. |
|
Authentication_Success | Successfully authenticates with the app. | (No parameters) |
Authentication_Failure | Fails to authenticate with the app. | (No parameters) |
clip_start | Starts watching a clip. |
|
app_cms_iap_event | Makes an in-app purchase. Note: In-app purchase events are exclusively for purchases made through the app store's payment system. |
|
ga_event | Interacts with the app in a way that is not covered by any of the other events. |
|
ad_start | An ad starts playing. |
|
ad_end | An ad ends playing. |
|
ViewLift/GA4 events for Apple TV
Event name | Event is pushed to GA4 when a user... |
---|---|
screen_view | Views a screen. |
MVPD_Provider_Page | Visits the website of an MVPD provider. |
MVPD_Sign_In_Page | Visits the sign-in page of an MVPD provider. |
MVPD_Selected | Selects an MVPD (multimedia video programming distributor) provider. Example, Comcast, DirecTV, Hulu. |
Authentication_Success | Is successfully authorized with a login password or authorization with a code from a browser. |
Authentication_Failure | Gets a “Verification failed” error on Apple TV. |
Application Started | Opens your app. |
page_view | Views a video detail page. |
playerError | Encounters some error in the player. |
ad_start | The ad has started playing successfully on the Apple TV player. |
ad_end | The ad has finished playing on the player. |
program_start | A video is loaded on the player and starts playing. |
FAQs - GA4
Q. How to find more data in the 'subscription success' event?
Once a subscription is completed, it creates an event named "subscription_event" in Google Analytics 4. This object holds the following information about subscription activity:
const eventItems = { 'Name': user.name, 'Email': user.email, 'userId': user.userId, 'subscriptionPlan': planDetails, 'subscriptionStartDate': currentDate, 'subscriptionEndDate': planDuration, 'transactionAmount': planAmount, 'paymentHandler': paymentMode, 'subscribed_via_platform': 'Web', 'subscribed_from_country': countryCode, 'localCurrency': currencyCode, }
Parameters and description
- Name: The user's name
- Email: The user's email address
- UserId: The user's unique identifier
- SubscriptionPlan: The name of the subscription plan
- SubscriptionStartDate: The date the subscription started
- SubscriptionEndDate: The date the subscription ends
- TransactionAmount: The amount of the subscription
- PaymentHandler: The method of payment used
- SubscribedViaPlatform: The platform used to subscribe (in this case, "Web")
- SubscribedFromCountry: The country the user is from
- LocalCurrency: The user's local currency
Existing custom events in GA3 / Firebase
Following is a list of custom events that we currently track on the web and apps. To access the Events report, from your UA/Firebase property, click Reports > Engagement > Events.
- Page Viewed (page_view)
- Added to Watchlist
- Removed From Watchlist
- Player BitRate changed
- Play Started
- Media Error
- Watched
- View Plans
- Shared
- Logout
- Login
- Signed Up
- Subscription Initiated
- Searched