Pumpjack Dataworks Analytics SDK

Reporting Views & Events

The SDK can report various types of events to the server.

Note

"category" is not a constant and it has to be defined based on the application events, categories etc.

Report Screen Views

Please add this code in viewWillAppear methods, for triggering each screen view.

PJDSDK.sharedInstance.reportEvent(eventType: PJDEventType.VIEWED, viewName: "{SCREEN_NAME}", category: "category_value")

Report Tap, Logout and other Events

PJDSDK.sharedInstance.reportEvent(eventType: PJDEventType.CLICKED, inView: "{SCREEN_NAME}", withOptions: ["key1": "val1", "key2": "val2"], category: "category_value")

If you want to report an event when a user logs out of their account in the app.

PJDSDK.sharedInstance.reportEvent(eventType: PJDEventType.LOGGEDOUT, category: "category_value")

If user wants to track app opened, terminated, then these methods can be called from relevant delegate methods

PJDSDK.sharedInstance.reportEvent(eventType: PJDEventType.OPENED, category: "category_value")
PJDSDK.sharedInstance.reportEvent(eventType: PJDEventType.FOREGROUNDED, category: "category_value")
PJDSDK.sharedInstance.reportEvent(eventType: PJDEventType.BACKGROUNDED, category: "category_value")

See Appendix A for all types of events available.

Update SDK Permissions

To update permissions for reporting of events sdk has following method:

PJDSDK.sharedInstance.updatePermissions(permissions: permissions)

See section (#2-initialization) for how to create “permissions”