Deep Dive into User Engagement Analysis

In my previous post, I covered basic metrics that define user behavior, such as total visits, average page views, and traffic source distribution.

While these metrics are essential for understanding overall site performance, advanced engagement analysis can provide deeper insights into how users interact with your site.

In this post, we’ll look at more sophisticated engagement metrics using the Google Analytics Sample Dataset in BigQuery.

We’ll explore engagement depth, content engagement, user flow, event-based engagement, and time to purchase.

1. Engagement Depth Analysis

Understanding how deeply users engage with your site can help identify the correlation between engagement and conversion rates. We’ll analyze sessions based on the number of page views.

  • Depth of Engagement: Examine how the number of pages viewed per session relates to session duration and conversion rate.
  • Insights: Sessions with higher pageviews tend to have longer durations and higher conversion rates, indicating more engaged users are more likely to convert.
SQL
SELECT
  CASE 
    WHEN totals.pageviews = 1 THEN '1 page'
    WHEN totals.pageviews BETWEEN 2 AND 5 THEN '2-5 pages'
    WHEN totals.pageviews BETWEEN 6 AND 10 THEN '6-10 pages'
    ELSE '10+ pages'
  END AS pageview_bucket,
  COUNT(*) AS sessions,
  AVG(totals.timeOnSite) AS avg_session_duration,
  ROUND(100 * COUNTIF(totals.transactions > 0) / COUNT(*), 2) AS conversion_rate
FROM
  `bigquery-public-data.google_analytics_sample.ga_sessions_*`
WHERE
  _TABLE_SUFFIX BETWEEN '20170101' AND '20170331'
GROUP BY
  pageview_bucket
ORDER BY
  sessions DESC;

Explanation

  • pageview_bucket: Categorizes sessions based on the number of pages viewed.
  • sessions: Counts the number of sessions in each pageview bucket.
  • avg_session_duration: Calculates the average duration of sessions in each bucket.
  • conversion_rate: Computes the conversion rate for each pageview bucket by dividing the number of transactions by the number of sessions and multiplying by 100.

2. Content Engagement Analysis

Identifying top-performing and underperforming content can help optimize your site.

  • Top-Performing Content: Identify pages with the highest pageviews and longest average time on page.
  • Underperforming Content: Detect pages with high exit rates to find areas needing improvement.
SQL
SELECT
  hits.page.pagePath,
  COUNT(*) AS pageviews,
  AVG(hits.time) AS avg_time_on_page,
  SUM(CAST(hits.isExit AS INT64)) AS exits,
  ROUND(100 * SUM(CAST(hits.isExit AS INT64)) / COUNT(*), 2) AS exit_rate
FROM
  `bigquery-public-data.google_analytics_sample.ga_sessions_*`,
  UNNEST(hits) AS hits
WHERE
  _TABLE_SUFFIX BETWEEN '20170101' AND '20170331'
  AND hits.type = 'PAGE'
GROUP BY
  hits.page.pagePath
ORDER BY
  pageviews DESC
LIMIT 20;

Explanation

  • pagePath: The URL path of the page.
  • pageviews: Counts the number of pageviews for each page.
  • avg_time_on_page: Calculates the average time users spend on each page.
  • exits: Counts the number of times users exited from each page.
  • exit_rate: Computes the exit rate for each page by dividing the number of exits by the number of pageviews and multiplying by 100.

3. User Flow Analysis

Understanding the common user paths through your site can help optimize navigation.

  • Common User Paths: Identify the most frequent page sequences to understand user navigation.
  • Optimization Opportunities: Improve user flow by enhancing navigation and linking related content.
SQL
WITH page_sequence AS (
  SELECT
    fullVisitorId,
    visitId,
    hits.page.pagePath,
    hits.hitNumber,
    LEAD(hits.page.pagePath) OVER (PARTITION BY fullVisitorId, visitId ORDER BY hits.hitNumber) AS next_page
  FROM
    `bigquery-public-data.google_analytics_sample.ga_sessions_*`,
    UNNEST(hits) AS hits
  WHERE
    _TABLE_SUFFIX BETWEEN '20170101' AND '20170331'
    AND hits.type = 'PAGE'
)
SELECT
  pagePath AS current_page,
  next_page,
  COUNT(*) AS frequency
FROM
  page_sequence
WHERE
  next_page IS NOT NULL
GROUP BY
  current_page, next_page
ORDER BY
  frequency DESC
LIMIT 20;

Explanation

  • page_sequence: Creates a sequence of pages visited within each session.
  • current_page: The current page in the sequence.
  • next_page: The page that follows the current page in the sequence.
  • frequency: Counts the number of times users navigate from the current page to the next page.

4. Event-Based Engagement Analysis

Analyze user interactions with specific site elements.

  • Popular Features: Identify the most frequent events to understand user interactions.
  • Improvement Areas: Detect less-used features to identify potential areas for improvement.
SQL
SELECT
  hits.eventInfo.eventCategory,
  hits.eventInfo.eventAction,
  COUNT(*) AS event_count
FROM
  `bigquery-public-data.google_analytics_sample.ga_sessions_*`,
  UNNEST(hits) AS hits
WHERE
  _TABLE_SUFFIX BETWEEN '20170101' AND '20170331'
  AND hits.type = 'EVENT'
GROUP BY
  hits.eventInfo.eventCategory,
  hits.eventInfo.eventAction
ORDER BY
  event_count DESC
LIMIT 20;

Explanation

  • eventCategory: The category of the event.
  • eventAction: The action of the event.
  • event_count: Counts the number of occurrences of each event.

5. Time to Purchase Analysis

Analyze the time it takes for users to make a purchase.

  • Time to Purchase: Understand the distribution of time it takes for users to make a purchase.
  • Optimization: Develop strategies to shorten the purchase funnel and reduce time to purchase.
SQL
WITH purchase_sessions AS (
  SELECT
    fullVisitorId,
    visitId,
    MAX(hits.time) / 1000 AS time_to_purchase
  FROM
    `bigquery-public-data.google_analytics_sample.ga_sessions_*`,
    UNNEST(hits) AS hits
  WHERE
    _TABLE_SUFFIX BETWEEN '20170101' AND '20170331'
    AND totals.transactions > 0
  GROUP BY
    fullVisitorId, visitId
)
SELECT
  CASE
    WHEN time_to_purchase < 60 THEN '< 1 min'
    WHEN time_to_purchase < 300 THEN '1-5 mins'
    WHEN time_to_purchase < 900 THEN '5-15 mins'
    ELSE '15+ mins'
  END AS time_bucket,
  COUNT(*) AS purchase_count,
  AVG(time_to_purchase) AS avg_time_to_purchase
FROM
  purchase_sessions
GROUP BY
  time_bucket
ORDER BY
  purchase_count DESC;

Explanation

  • purchase_sessions: Identifies sessions with transactions and calculates the time to purchase for each session.
  • time_bucket: Categorizes sessions based on the time taken to make a purchase.
  • purchase_count: Counts the number of purchases in each time bucket.
  • avg_time_to_purchase: Calculates the average time to purchase in each bucket.

You can find the complete code in my GitHub repository.

Results

1. Engagement Depth Analysis

The analysis of engagement depth categorizes sessions based on the number of page views per session and provided insights into session duration and conversion rates for each category.

The data shows a clear correlation between the depth of engagement and session duration, as well as conversion rates. Users who viewed more pages per session had significantly longer session durations and higher conversion rates.

Notably, sessions with more than 10 page views had an average duration of over 13 minutes and a conversion rate of 14.19%, indicating that deeply engaged users are more likely to convert.

Pageview BucketSessionsAvg. Session Duration (seconds)Conversion Rate (%)
1 page98,84262.100.00
2-5 pages63,785127.580.01
6-10 pages18,794320.010.53
10+ pages15,396804.0814.19

2. Content Engagement Analysis

This analysis focuses on identifying top-performing and underperforming content by evaluating pageviews, average time on page, and exit rates.

The homepage (/home) has the highest number of pageviews but also a high exit rate of 42.32%, indicating that while many users land on the homepage, a large proportion leave without further interaction.

Pages related to “google+redesign” showe high engagement with long average time on page, but some also have high exit rates, suggesting potential areas for content improvement or user flow optimization.

For example, the “shop+by+brand/youtube” page has a high exit rate of 43.74%, indicating that users may not find what they are looking for or that the page could be optimized further.

Page PathPageviewsAvg. Time
on Page
(seconds)
ExitsExit Rate (%)
/home201,47878,50185,26742.3
/basket.html49,173571,7425,86011.9
/google+redesign/shop+by+brand/youtube39,80192,58417,40843.7
/signin.html22,229272,6274,23219.0
/store.html15,669423,1652,07913.3
/google+redesign/apparel/men++s/men++s+t+shirts15,127182,5744,79631.7
/asearch.html
14,770
238,2784,928
33.4
/google+redesign/apparel/men++s/men++s+outerwear13,688183,3833,14623.0
/google+redesign/shop+by+brand/google12,453221,8103,47627.9
/google+redesign/apparel10,672247,3762,19220.5
/google+redesign/bags/backpacks/home10,139252,7311,43614.2
/google+redesign/electronics8,986260,6752,30625.7
/google+redesign/bags8,923264,9731,99222.3
/google+redesign/accessories8,549311,1261,44917.0
/google+redesign/accessories/fun8,215341,14598912.0
/yourinfo.html8,176812,06892011.3
/google+redesign/drinkware7,633248,3572,21929.1
/google+redesign/accessories/stickers/home7,273283,3941,19816.5
/google+redesign/shop+by+brand/youtube/quickview6,856205,61589213.0
/payment.html6,7741,006,7415317.8

3. User Flow Analysis

The user flow analysis shows the most common paths users take on the site, which can be critical for understanding how to improve site navigation and user experience.

For instance, many users transition from the homepage to revisiting the homepage or exploring product categories like “shop+by+brand/youtube” and “shop+by+brand/google.”

The frequent navigation from “basket.html” to “signin.html” and then to “yourinfo.html” suggests that users are actively moving through the checkout process.

Enhancing these commonly traversed paths can help streamline user journeys and improve overall site usability.

Understanding these common pathways allows for targeted improvements to keep users engaged and reduce drop-off rates.

Current PageNext PageFrequency
/home/home45,199
/basket.html/basket.html9,407
/home/google+redesign/shop+by+brand/youtube7,700
/basket.html/signin.html6,648
/google+redesign/shop+by+brand/youtube/home6,227
/home/google+redesign/shop+by+brand/google6,174
/basket.html/yourinfo.html5,322
/home/google+redesign/apparel/men++s/men++s+outerwear5,164
/signin.html/signin.html4,582
/yourinfo.html/payment.html4,440
/myaccount.html?mode=vieworder/myaccount.html?mode=vieworderdetail4,018
/google+redesign/shop+by+brand/youtube/google+redesign/shop+by+brand/youtube/quickview3,950
/signin.html/registersuccess.html3,915
/home/asearch.html3,698
/registersuccess.html/store.html3,651
/basket.html/store.html3,383
/payment.html/revieworder.html3,136
/asearch.html/asearch.html2,905
/google+redesign/bags/backpacks/home/google+redesign/bags/backpacks//quickview2,896
/store.html/basket.html2,734

4. Event-Based Engagement Analysis

This analysis focuses on user interactions with specific site elements by evaluating the frequency of different events.

Event-based engagement analysis reveals that “Quickview Click” and “Add to Cart” are the most frequent actions, indicating high user interest in viewing product details and adding items to their cart.

The significant number of “Remove from Cart” events suggests that users may reconsider their choices, highlighting a potential area to investigate for improving cart retention and reducing abandonment rates.

Understanding these interactions can help refine features to better meet user needs and preferences.

Event CategoryEvent ActionEvent Count
Enhanced EcommerceQuickview Click70,047
Enhanced EcommerceAdd to Cart23,478
Enhanced EcommerceProduct Click15,519
nullnull7,155
Enhanced EcommerceRemove from Cart2,968
Contact UsOnsite Click1,481
Enhanced EcommercePromotion Click17

5. Time to Purchase Analysis

This analysis examined the time it takes for users to make a purchase.

The time to purchase analysis shows that most users make purchases within 5-15 minutes of their session, followed by those taking longer than 15 minutes.

This suggests that while many users make quick decisions, a substantial number require more time to decide, indicating opportunities to streamline the purchase process and reduce decision time for users.

Time BucketPurchase CountAvg. Time to Purchase (seconds)
5-15 mins1,084573.0
15+ mins9631,795.8
1-5 mins240223.3
< 1 min10.0

Conclusion

Advanced engagement analysis provides a comprehensive understanding of how users interact with an e-commerce site.

By examining deeper metrics such as engagement depth, content engagement, user flow, event interactions, and time to purchase, we can gain valuable insights that go beyond basic metrics.

These insights enable more targeted and effective strategies to enhance user experience, optimize site performance, and ultimately drive higher conversion rates.

Implementing these findings can lead to a more engaging, user-friendly website that not only attracts visitors but also retains them and encourages them to complete their transactions.

As the digital landscape continues to evolve, ongoing analysis and optimization are crucial for maintaining a competitive edge and meeting the ever-changing needs of users.

RSS
Follow by Email
LinkedIn
Share