evollu / react-native-firebase-analytics

React native bridge for firebase analytics
MIT License
206 stars 54 forks source link

Tracking Screen Views #63

Open ghost opened 7 years ago

ghost commented 7 years ago

Is there a way to track screen view particular to a user as we do in google analytics ?

rturk commented 7 years ago

Just log your screen

Something like this..

import Analytics from 'react-native-firebase-analytics';

    // somewhere in your code, for example componentDidMount
    // Firebase Analytics
    Analytics.logEvent('view_my_screenX', {
      'item_id': product._id,
      'in_stock': product.inStock,
      'some_nice': "other_value"
    });
ankittparikh commented 7 years ago

Will this work ? for tracking screen view ?

Analytics.logEvent("screen_view",{ "name":"my_screen_name" })

evollu commented 7 years ago

Analytics.setScreenName('my_screen_name')?

rturk commented 7 years ago

@evollu I think Analytics.setScreenName('Screen Name') makes more sense, however one needs to be careful to tag all screens otherwise screen names will be incorrectly assigned to the last tagged screen

sibelius commented 7 years ago

I think he wants to track screen with custom dimensions

https://github.com/idehub/react-native-google-analytics-bridge/blob/master/src/GoogleAnalyticsTracker.js#L82

evollu commented 7 years ago

@sibelius I don’t think firebase SDK supports that