Home Blog Service Analytics

How to Use Google Analytics App + Web Tracking Feature

Author Image
Alex is a senior analytics expert @Viden with years of experience in analytics strategy and data collection planning, driving value for brands through data-driven insights.
How to Use Google Analytics App + Web Tracking Feature

Not so long ago, Google released a new feature – ‘App + Web Property’ that allows tracking data from both mobile apps and websites. In this blog post, we will learn what features ‘App + Web Property’ offers.

Content:

  1. Enhanced Measurement (Web)
  2. Event Measurement
  3. eCommerce Measurement (App)
  4. Summary

Unlike other Google Analytics Properties, data in ‘App + Web Property’ is divided into so-called ‘Data Streams.’ For example, if you want to track combined data from a website, an iOS app, and an Android app, you would need to create 3 data streams for the website and iOS and Android apps.

1. Enhanced Measurement (Web)

Google provides the ‘Enhanced Measurement’ feature for the website data stream, automatically tracking page views, scrolls, outbound clicks, site searches, video engagement, and file downloads. All you need to do is enable it:

Page views – automatically enabled via Enhanced Measurement. Additionally, page views can be tracked based on ‘history-based’ events.
Scrolls – pretty straightforward – the event is fired when a page is scrolled to the bottom. No need for additional configuration.
Outbound clicks – relevant for all businesses to gain insights on which external domains or links take the user off your site.
Site Search – enable this feature if you have site search functionality available on your website. When a user searches, a special parameter is added to the URL – you should specify this parameter in the additional configuration to make the site search event fired.
Video engagement – enable to track YouTube videos on your website.
File downloads – the event is fired when a user clicks a link leading to a file (pdf, doc, Xls, etc.)

2. Event Measurement

Events are needed to show what actions take place on your app and website, e.g., clicks, form submissions, errors, etc. In the App + Web property, many events are tracked automatically (for apps), so there is no need to add any.

Automatically Collected Events (App)

Once the iOS or Android SDK is implemented in your app, some events such as first_visit, session_start, user_engagement, and page_view are tracked automatically.

Recommended Events (App)

Depending on your business type/category, App + Web Property offers recommended events. You can send these recommended events along with their prescribed parameters to get maximum benefits.

But what if neither automatically collected events nor recommended events allow you to track required actions? Then, use custom events (you can log up to 500 different Analytics event types).

Further reading: Passing Customers Data to Google Analytics from Shopify

Custom Events (App)

To implement a custom event in your app, you should:

  1. Know exactly under what conditions the event should be fired
  2. Think about event taxonomy (event name, parameters)
  3. Prepare a code snippet for the implementation to send to developers

For example, you need to track when a user taps a specific CTA button (e.g., ‘Buy Now’) in your app (iOS and Android) on a particular screen (e.g., on the main screen).

Where ‘CTA’ is ‘event name’; ‘event_label’ is a custom parameter to track button title (‘Buy Now’) and ‘event_category’ is a custom parameter to track event location (main screen).

The following code snippets can be used:

Swift:

Analytics.logEvent("cta", parameters: [
  "event_label": "buy_now" as NSObject,
  "event_category": "main_screen" as NSObject
])

Java:

Bundle params = new Bundle();
params.putString("event_label", "buy_now");
params.putString("event_category", "main_screen");
mFirebaseAnalytics.logEvent("cta", params);

Notes:

  1. Link to the Firebase documentation on logging events (Android)
  2. Link the Firebase documentation on log events (iOS)
  3. Always set up parameter reporting in your ‘App + Web’ property; you must assign parameters to the specific event under the ‘All events’ tab

Conversions (App)

Conversions show how many conversion events were driven by each aspect of your marketing and the value of those events. You can mark any event as a conversion in Google Analytics:

User Properties (App)

User properties are attributes that can describe segments of your user base, such as language preference, geographic location, etc. Analytics automatically logs some of the user properties. Additionally, 25 user properties can be set up per project.

For example, you need to track user status e.g., ‘guest’ or ‘customer’.
Where ‘user_status’ is a user property name; ‘guest’ or ‘customer’ is a user property value.

The following code snippets can be used for ‘guest’:

Swift:

Analytics.setUserProperty("guest", forName: "user_status")

Kotlin:

firebaseAnalytics.setUserProperty("user_status", "guest")

3. eCommerce Measurement (App)

In addition to conversions, sending the whole set of eCommerce events is advantageous to understand the full conversion cycle. The list of supported events includes events such as view_item, add_to_cart, and begin_checkout that come along with a list of suggested parameters to enable deep and powerful product analysis.

Android Purchase Code Snippet

Below is the code example to track purchases on an Android app that are not processed in Play Market. Values in <> brackets are dynamic, so they should be pulled dynamically for each purchase with corresponding values.

// Define product with relevant parameters
Bundle product1 = new Bundle();
product1.putString( Param.ITEM_ID, "");            // ITEM_ID or ITEM_NAME is required
product1.putString( Param.ITEM_NAME, "");         // Item Name
product1.putString( Param.ITEM_CATEGORY, ""); // Item Category
product1.putString( Param.ITEM_VARIANT, "");   // Item Variant
product1.putString( Param.ITEM_BRAND, "");       // Item Brand
product1.putDouble( Param.PRICE, "");            // Item Price
product1.putString( Param.CURRENCY, "" );         // Item-level currency unused today 
product1.putLong( Param.QUANTITY, "");        // Item Quantity

// Prepare ecommerce bundle
ArrayList items = new ArrayList();
items.add(product1);
Bundle ecommerceBundle = new Bundle();
ecommerceBundle.putParcelableArrayList( "items", items );

// Set relevant transaction-level parameters
ecommerceBundle.putString( Param.TRANSACTION_ID, "" );
ecommerceBundle.putString( Param.AFFILIATION, "" );
ecommerceBundle.putDouble( Param.VALUE, "" );        
ecommerceBundle.putDouble( Param.TAX, "" );
ecommerceBundle.putDouble( Param.SHIPPING, "" );
ecommerceBundle.putString( Param.CURRENCY, "" );
ecommerceBundle.putString( Param.COUPON, "" );

// Log purchase event with eCommerce bundle
mFirebaseAnalytics.logEvent( Event.PURCHASE, ecommerceBundle );

Notes:

  1. Link to the Firebase documentation about the ‘ECOMMERCE_PURCHASE’ event.
  2. Link to the developer documentation about Android ‘ECOMMERCE_PURCHASE’ event.
  3. The code above should not repeatedly fire when a user reloads the confirmation screen or navigates back to the confirmation screen (this will lead to transaction duplication and revenue discrepancy).

Further reading: Google Analytics — eCommerce Overview

iOS Purchase Code Snippet

Below is the code example to track purchases on an iOS app that are not processed in the App Store. Values in <> brackets are dynamic, so they should be pulled dynamically for each purchase with corresponding values.

// Define products with relevant parameters.
NSDictionary *product1 = @{
   kFIRParameterItemID : @"",            // ITEM_ID or ITEM_NAME is required
   kFIRParameterItemName : @"",         // Item Name
   kFIRParameterItemCategory : @"", // Item Category
   kFIRParameterItemVariant : @"",   // Item Variant
   kFIRParameterItemBrand : @"",       // Item Brand
   kFIRParameterPrice : @,             // Item Price
   kFIRParameterCurrency : @"",         // Item-level currency unused today
   kFIRParameterQuantity : @        // Item Quantity
};

// Prepare ecommerce dictionary.
NSArray *items = @[product1];
NSDictionary *ecommerce = @{
   @"items" : items,
   kFIRParameterItemList : @"",         
   kFIRParameterTransactionID : @"",
   kFIRParameterAffiliation : @"",
   kFIRParameterValue : @,               
   kFIRParameterTax : @,
   kFIRParameterShipping : @,
   kFIRParameterCurrency : @"",
   kFIRParameterCoupon : @""
};

// Log purchase event with ecommerce dictionary.
Analytics.logEvent(AnalyticsEventPurchase, parameters:ecommerce)

Notes:

  1. Link to the Firebase documentation ‘ECOMMERCE_PURCHASE’ event.
  2. Link to the developer documentation about the iOS ‘ECOMMERCE_PURCHASE’ event.
  3. The code above should NOT fire repeatedly when a user reloads the confirmation screen or navigates back to the confirmation screen (this will lead to transaction duplication and revenue discrepancy).

Summary

App + Web Property is a great feature with a cross-platform measurement. There is no need for additional set-up, e.g., outbound link clicks. Just enable the ‘Enhanced Measurement’ feature for the web data stream, and that is it. App + Web provides a large list of automatically collected events for apps. However, of course, to track macro and micro conversions, you would need to implement custom tracking (events, user properties for apps). Moreover, App + Web Property provides great built-in Funnel and Path Analysis Reports that are not available in other Google Analytics Properties. You can learn more about it in our Google Analytics App + Web Property Walkthrough blog post.

Get in touch

Got a question? We'd love to hear from you. Send us a message and we'll respond as soon as possible.



    By clicking submit, you agree to our Privacy Policy

    Latest Insights

    Get the tips from our experts to optimize and scale your campaigns

    20 June 2024

    The Importance of Using Analytics in Advertising

    Nowadays, businesses face the challenge of constantly refining their advertising campaigns to optimize performance. Given the complexity of the modern consumer’s journey, with its numerous touchpoints and channels, leveraging analytics in advertising plays a crucial role for businesses in achieving their desired outcomes. In 2022, Gartner reported that 53% of marketing decisions were driven by […]

    Learn more

    13 June 2024

    Prevent Data Loss: Set Up BigQuery Error Notifications

    BigQuery has gained significant popularity and is increasingly utilized in numerous projects. Google’s cloud-based data warehouse solution is known for its scalability, speed, and ability to handle large datasets efficiently. As more organizations integrate BigQuery into their data processing and analytics workflows, robust monitoring and alerting mechanisms are essential. Implementing alerts for jobs that encounter […]

    Learn more

    30 May 2024

    How To Create A Meaningful Ecommerce Analytics Dashboard: A Step-by-step Guide

    Are you drowning in a huge amount of e-commerce data? There’s no other way to escape it if you want your e-commerce store to succeed. However, you can make analyzing your data much more enjoyable and effective. The key is to present e-commerce data analytics visually. Data visualization plays a big role in data-driven decision-making. […]

    Learn more

    28 March 2024

    Navigating the Data Deluge: Prioritizing Key Metrics in the Age of Google Analytics 4

    With the advent of Google Analytics 4 (GA4), the key business challenge becomes not collecting data but discerning what truly matters in the sea of data. 64% of marketing executives believe data-driven marketing is crucial to success in a hyper-competitive global economy. By prioritizing key metrics and avoiding the trap of tracking everything, businesses can […]

    Learn more

    3 January 2024

    How to Create a Viable First-Party Data Strategy in 2024?

    Discover the 9 key steps to build a first-party data strategy that maximizes customer data and enhances your marketing efforts.

    Learn more

    30 November 2023

    Maximize Your Data Retention in Google Analytics 4 (GA4) 

    Learn how to manage data storage and protect privacy with GA4 data retention settings.

    Learn more

    24 November 2023

    How to Read and Interpret Google Analytics 4 Reports to Drive Business Success

    Get to know how to read Google Analytics 4 reports to uncover customer insights, optimize marketing strategies, and drive business growth.

    Learn more

    11 November 2023

    How to Preserve Google Analytics Historical Data

    Fearing to lose your Google Analytics’ historical data? Don't worry! This guide will show you four ways to save data during the UA-to-GA4 migration.

    Learn more