firebase / firebase/firebase-ios-sdk

Time spent in screens by content group remains at 0 seconds

Open
#16,376 8 comments 0 reactions 0 assignees View on GitHub
api: analytics needs-attention type: bug
Dominant language
C++
Stars
6.7k
Forks
1.8k
Avg merge
2d 18h
Merged PRs (30d)
75

Description

### Description

In Google Analytics, the time spent per content group remains at 0 seconds, but the time spent per screen is correct. All time spent, by content group, seems to be directed toward an empty content group. In addition, we're seeing this behavior only on iOS, not on Android. The implementation seems to be properly implemented, with a `screenView` event that includes `screenName`, `screenClass`, and “content_group.”

Image
Image

### Reproducing the issue

Send manually screenView events like:
Analytics.logEvent(AnalyticsEventScreenView, parameters: [
AnalyticsParameterScreenName: "screenName",
AnalyticsParameterScreenClass: "screenClass",
"content_group": "ContentGroup"]
)
In Google Analytics, every time spent in the app is a empty content group and not in the ones we defined.

### Firebase SDK Version

11.15.0

### Xcode Version

26,6

### Installation Method

CocoaPods

### Firebase Product(s)

Analytics

### Targeted Platforms

All

### Relevant Log Output

```shell

```

### If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet

```json

Replace this line with the contents of your Package.resolved.

```

### If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet

```yml

PODS:
- Adjust (5.7.0):
- Adjust/Adjust (= 5.7.0)
- Adjust/Adjust (5.7.0):
- AdjustSignature (= 3.67.0)
- AdjustSignature (3.67.0)
- Alamofire (5.11.2)
- AlamofireImage (4.4.0):
- Alamofire (~> 5.11)
- AlignedCollectionViewFlowLayout (1.1.2)
- Charts (4.1.0):
- Charts/Core (= 4.1.0)
- Charts/Core (4.1.0):
- SwiftAlgorithms (~> 1.0)
- Cosmos (25.0.1)
- CryptoSwift (1.10.0)
- DeviceKit (5.8.0)
- DLRadioButton (1.4.12)
- DynamicColor (5.0.1)
- Firebase (11.15.0):
- Firebase/Core (= 11.15.0)
- Firebase/Analytics (11.15.0):
- Firebase/Core
- Firebase/Core (11.15.0):
- Firebase/CoreOnly
- FirebaseAnalytics (~> 11.15.0)
- Firebase/CoreOnly (11.15.0):
- FirebaseCore (~> 11.15.0)
- Firebase/InAppMessaging (11.15.0):
- Firebase/CoreOnly
- FirebaseInAppMessaging (~> 11.15.0-beta)
- Firebase/Messaging (11.15.0):
- Firebase/CoreOnly
- FirebaseMessaging (~> 11.15.0)
- FirebaseABTesting (11.15.0):
- FirebaseCore (~> 11.15.0)
- FirebaseAnalytics (11.15.0):
- FirebaseAnalytics/Default (= 11.15.0)
- FirebaseCore (~> 11.15.0)
- FirebaseInstallations (~> 11.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- GoogleUtilities/MethodSwizzler (~> 8.1)
- GoogleUtilities/Network (~> 8.1)
- "GoogleUtilities/NSData+zlib (~> 8.1)"
- nanopb (~> 3.30910.0)
- FirebaseAnalytics/Default (11.15.0):
- FirebaseCore (~> 11.15.0)
- FirebaseInstallations (~> 11.0)
- GoogleAppMeasurement/Default (= 11.15.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- GoogleUtilities/MethodSwizzler (~> 8.1)
- GoogleUtilities/Network (~> 8.1)
- "GoogleUtilities/NSData+zlib (~> 8.1)"
- nanopb (~> 3.30910.0)
- FirebaseCore (11.15.0):
- FirebaseCoreInternal (~> 11.15.0)
- GoogleUtilities/Environment (~> 8.1)
- GoogleUtilities/Logger (~> 8.1)
- FirebaseCoreInternal (11.15.0):
- "GoogleUtilities/NSData+zlib (~> 8.1)"
- FirebaseInAppMessaging (11.15.0-beta):
- FirebaseABTesting (~> 11.0)
- FirebaseCore (~> 11.15.0)
- FirebaseInstallations (~> 11.0)
- GoogleUtilities/Environment (~> 8.1)
- GoogleUtilities/UserDefaults (~> 8.1)
- nanopb (~> 3.30910.0)
- FirebaseInstallations (11.15.0):
- FirebaseCore (~> 11.15.0)
- GoogleUtilities/Environment (~> 8.1)
- GoogleUtilities/UserDefaults (~> 8.1)
- PromisesObjC (~> 2.4)
- FirebaseMessaging (11.15.0):
- FirebaseCore (~> 11.15.0)
- FirebaseInstallations (~> 11.0)
- GoogleDataTransport (~> 10.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- GoogleUtilities/Environment (~> 8.1)
- GoogleUtilities/Reachability (~> 8.1)
- GoogleUtilities/UserDefaults (~> 8.1)
- nanopb (~> 3.30910.0)
- FontAwesome.swift (1.9.1)
- GoogleAdsOnDeviceConversion (2.1.0):
- GoogleUtilities/Logger (~> 8.1)
- GoogleUtilities/Network (~> 8.1)
- nanopb (~> 3.30910.0)
- GoogleAppMeasurement/Core (11.15.0):
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- GoogleUtilities/MethodSwizzler (~> 8.1)
- GoogleUtilities/Network (~> 8.1)
- "GoogleUtilities/NSData+zlib (~> 8.1)"
- nanopb (~> 3.30910.0)
- GoogleAppMeasurement/Default (11.15.0):
- GoogleAdsOnDeviceConversion (= 2.1.0)
- GoogleAppMeasurement/Core (= 11.15.0)
- GoogleAppMeasurement/IdentitySupport (= 11.15.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- GoogleUtilities/MethodSwizzler (~> 8.1)
- GoogleUtilities/Network (~> 8.1)
- "GoogleUtilities/NSData+zlib (~> 8.1)"
- nanopb (~> 3.30910.0)
- GoogleAppMeasurement/IdentitySupport (11.15.0):
- GoogleAppMeasurement/Core (= 11.15.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- GoogleUtilities/MethodSwizzler (~> 8.1)
- GoogleUtilities/Network (~> 8.1)
- "GoogleUtilities/NSData+zlib (~> 8.1)"
- nanopb (~> 3.30910.0)
- GoogleDataTransport (10.1.0):
- nanopb (~> 3.30910.0)
- PromisesObjC (~> 2.4)
- GoogleUtilities/AppDelegateSwizzler (8.1.2):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Privacy
- GoogleUtilities/Environment (8.1.2):
- GoogleUtilities/Privacy
- GoogleUtilities/Logger (8.1.2):
- GoogleUtilities/Environment
- GoogleUtilities/Privacy
- GoogleUtilities/MethodSwizzler (8.1.2):
- GoogleUtilities/Logger
- GoogleUtilities/Privacy
- GoogleUtilities/Network (8.1.2):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Privacy
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (8.1.2)":
- GoogleUtilities/Privacy
- GoogleUtilities/Privacy (8.1.2)
- GoogleUtilities/Reachability (8.1.2):
- GoogleUtilities/Logger
- GoogleUtilities/Privacy
- GoogleUtilities/UserDefaults (8.1.2):
- GoogleUtilities/Logger
- GoogleUtilities/Privacy
- GradientProgressBar (3.0.0)
- KeychainSwift (24.0.0)
- lottie-ios (4.6.1)
- nanopb (3.30910.0):
- nanopb/decode (= 3.30910.0)
- nanopb/encode (= 3.30910.0)
- nanopb/decode (3.30910.0)
- nanopb/encode (3.30910.0)
- PromisesObjC (2.4.1)
- R.swift (7.8.0)
- SDWebImage (5.21.7):
- SDWebImage/Core (= 5.21.7)
- SDWebImage/Core (5.21.7)
- SkeletonView (1.30.4)
- Swift_PageMenu (1.4.2)
- SwiftAlgorithms (1.0.0)
- SwiftEntryKit (2.0.0)
- SwiftLint (0.65.0)
- SWXMLHash (7.0.2)
- UIImageViewAlignedSwift (0.8.2)
- VerticalCardSwiper (2.3.1)
- youtube-ios-player-helper (1.0.4)

DEPENDENCIES:
- Adjust
- Alamofire
- AlamofireImage
- AlignedCollectionViewFlowLayout
- Charts
- Cosmos
- CryptoSwift
- DeviceKit
- DLRadioButton
- DynamicColor
- Firebase
- Firebase/Analytics
- Firebase/InAppMessaging
- Firebase/Messaging
- FontAwesome.swift
- GradientProgressBar
- KeychainSwift
- lottie-ios
- R.swift
- SDWebImage
- SkeletonView
- Swift_PageMenu
- SwiftEntryKit
- SwiftLint
- SWXMLHash
- UIImageViewAlignedSwift
- VerticalCardSwiper (= 2.3.1)
- youtube-ios-player-helper

SPEC REPOS:
https://github.com/CocoaPods/Specs.git:
- Adjust
- AdjustSignature
- Alamofire
- AlamofireImage
- AlignedCollectionViewFlowLayout
- Charts
- Cosmos
- CryptoSwift
- DeviceKit
- DLRadioButton
- DynamicColor
- Firebase
- FirebaseABTesting
- FirebaseAnalytics
- FirebaseCore
- FirebaseCoreInternal
- FirebaseInAppMessaging
- FirebaseInstallations
- FirebaseMessaging
- FontAwesome.swift
- GoogleAdsOnDeviceConversion
- GoogleAppMeasurement
- GoogleDataTransport
- GoogleUtilities
- GradientProgressBar
- KeychainSwift
- lottie-ios
- nanopb
- PromisesObjC
- R.swift
- SDWebImage
- SkeletonView
- Swift_PageMenu
- SwiftAlgorithms
- SwiftEntryKit
- SwiftLint
- SWXMLHash
- UIImageViewAlignedSwift
- VerticalCardSwiper
- youtube-ios-player-helper

SPEC CHECKSUMS:
Adjust: 3fbf26d0880cb25d15653d68278c0c8771718458
AdjustSignature: 9498705a4ac67b719e31828be4d74fbb8656950c
Alamofire: 400275dd1c6d87d95a041861d2a59da4b520a203
AlamofireImage: 19ec9c0991f52cc7f9ba6a9d4ec782e29bdf6210
AlignedCollectionViewFlowLayout: ee2ef451e741ec08f8e0967d828001e2f051c20a
Charts: ce0768268078eee0336f122c3c4ca248e4e204c5
Cosmos: 02db0a1c953107049bfd2d7af19ceef55ecb7e98
CryptoSwift: e2e7776512f250e66205955da748e7a4e4abffe0
DeviceKit: 57636054c827d171a22baa3fd320b65a70f3fda7
DLRadioButton: d7c4e225ed0e8013cef7be61455230c7557ad7c1
DynamicColor: d049834ef86d8ecf150b0ca1ebe54ee733a0ec22
Firebase: d99ac19b909cd2c548339c2241ecd0d1599ab02e
FirebaseABTesting: 5e9d432834aebf27ab72100d37af44dfbe8d82f7
FirebaseAnalytics: 6433dfd311ba78084fc93bdfc145e8cb75740eae
FirebaseCore: efb3893e5b94f32b86e331e3bd6dadf18b66568e
FirebaseCoreInternal: 9afa45b1159304c963da48addb78275ef701c6b4
FirebaseInAppMessaging: 684b346d8cea49531b9dcaca2c1dbbfa82516fb5
FirebaseInstallations: 317270fec08a5d418fdbc8429282238cab3ac843
FirebaseMessaging: 3b26e2cee503815e01c3701236b020aa9b576f09
FontAwesome.swift: 6b52cb7be66eacd28cbfaa0ca7ffd0de4a186a1d
GoogleAdsOnDeviceConversion: 2be6297a4f048459e0ae17fad9bfd2844e10cf64
GoogleAppMeasurement: 700dce7541804bec33db590a5c496b663fbe2539
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
GoogleUtilities: 766ace00c6b10d8148408f329d10c4f051931850
GradientProgressBar: 5447e7686fed1bd363507d817d533db8d43cb29e
KeychainSwift: 007c4647486e4563adca839cf02cef00deb3b670
lottie-ios: 6467ca7035120c5b0e0acee58bb679cf15875686
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
PromisesObjC: 752c3227f599e3467650e47ea36f433eeb10c273
R.swift: f573269ca45b2ab066c082e363dd4c2b297b0d71
SDWebImage: e9fc87c1aab89a8ab1bbd74eba378c6f53be8abf
SkeletonView: 5a050f6411e697abd4cda0a8d767013399dccd69
Swift_PageMenu: 6cc3e92540729606bd66c9b35a0886ed6c8ed899
SwiftAlgorithms: 38dda4731d19027fdeee1125f973111bf3386b53
SwiftEntryKit: 61b5fa36f34a97dd8013e48a7345bc4c4720be9a
SwiftLint: c94465bc87831f3e16c52b3569f0626de50bd7da
SWXMLHash: dd733a457e9c4fe93b1538654057aefae4acb382
UIImageViewAlignedSwift: 12b0b06da988015e6d5dec09ee29d5ae1a244848
VerticalCardSwiper: 68df635b354500f86934ea044ade37a264c044c6
youtube-ios-player-helper: e9b97535e816db3152179d84d999bc1807ecd689

PODFILE CHECKSUM: a9a0b8abad0933d7f9a5e5901945b685520b137a

COCOAPODS: 1.16.2

```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the provided Analytics.logEvent screenView call on iOS, then compare the resulting content-group attribution with Android. Trace the Firebase Analytics handling of screenView and the "content_group" parameter; done means non-empty defined content groups receive screen time on iOS without regressing screen-time reporting.

Written by the indexing model from the issue text.

Assessment

Tech stack
firebase, swift
Domain
analytics, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.