0

I have an app full of stories, and I want to see which stories users are reading.

I already installed Firebase Analytics, but all I'm seeing is this kind of content:

![enter image description here

I want to be able to see the specific title of the stories users are reading.

This is the ForEach loop I'm using:

 ForEach(modelData.stories.shuffled()) { item in
                    if item.paid == false {
                        NavigationLink {
                            StoryDetails(story: item)
                        } label: {
                            GeneralCard(isLocked: false, story: item)
                        }

                    }
                }

And on StoryDetails I have this code, I would like to see the title of the story inside Firebase Analytics.

VStack (spacing: 0) {
                Text(story.title)
                    .font(AppFont.detailTitle())
                    .bold()
                    .multilineTextAlignment(.center)
                    .foregroundColor(.mainColor)
                
                Text(story.category.rawValue)
                    .font(AppFont.detailDescription())
                    .multilineTextAlignment(.center)
                    .padding()
                    .foregroundColor(.mainColor)
                
                VStack(alignment: .leading, spacing: 20) {
                    
                    ForEach(story.text, id: \.self) { item in
                        VStack {
                            Text(item)
                                .font(AppFont.detailText())
                        }
                    }
                }
                //.padding(.horizontal, 10)
            }

Is this something that can be achieved?

Thanks in advance

1 Answer 1

0

You could set this up by manually logging your screenviews instead. For SwiftUI, it is something like this:

struct ContentView: View {
  var body: some View {
    Text("Hello, world!")
       // Logging screen name with class and a custom parameter.
      .analyticsScreen(name: "main_content",
                       class: "ContentView",
                       extraParameters: ["my_custom_param": 5])

      // OR Logging screen name only, class and extra parameters are optional.
      .analyticsScreen(name: "main_content")
  }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.