Snowplow ScreenEvents with Android Tracker

85 views
Skip to first unread message

AJ St. Aubin

unread,
Mar 30, 2016, 9:47:23 AM3/30/16
to Snowplow
Hello all, 

If this question has been posted before please let me know.  I have tried to search, but I am not finding anything. I am still fairly new to Android and now SnowPlow.

I am looking at the Android-tracker documentation on GitHub and I see a lot of the information on setting up the tracker and adding a screen view event.  My current disconnect is when and where to add Screen View Events. If I am reading the documentation and example code correctly, it looks like I just need to add screen events to the tracker by ID.  What ID do I use?  The Class names of the screens?

This is the example I am looking at here: https://github.com/snowplow/snowplow/wiki/Android-Tracker#screen-view

t1.track(ScreenView.builder() .name("HUD > Save Game") .id("screen23") .build());


Thank you for any help in advance,
 AJ

AJ St. Aubin

unread,
Mar 30, 2016, 10:25:52 AM3/30/16
to Snowplow
I took another look at this, and maybe the issue is I am thinking about it wrong.  


I thought I just added the track to the tracker, which I am now thinking is an incorrect assumption. 

Do I need to call the tracker.track when the Activity is loaded?  Potentially in OnCreateView?

My goal is to add a ScreenView Event when the user goes into a certain Activity. Is this the correct use of this Event type?

Thank you,
AJ

jo...@snowplowanalytics.com

unread,
Mar 30, 2016, 11:41:00 AM3/30/16
to Snowplow
Hi AJ,

The example events do not show when and where to use the events but rather just how to build them.  The placement and when they are called is entirely up to you!

When you call these events will depend on the structure and flow of your app.  

- Is each screen a Fresh Activity?  
- Are their any Fragments within the Activity / does other information get loaded dynamically?  
- Is the application comprised solely of one Activity and many Fragments that are swapped in and out?

As to when to call it; the end of the OnCreate() / OnCreateView() functions are probably the best spot for this type of event.  For the ID you would use whatever logically identifies this screen to you; this could well be the class name of the Activity or Fragment.


What exactly are you trying to figure out within your application?


Cheers,
Josh

AJ St. Aubin

unread,
Mar 30, 2016, 1:35:31 PM3/30/16
to Snowplow
I think I understand the workflow now.  

I was using the ScreenView Event as a method to test out the data flow with out Collector.  It was an easy test to make sure I can see the date on the other end of the pipeline.  

I think I am all set now to proceed with it.

Thank you for your help.
Reply all
Reply to author
Forward
0 new messages