Added automatic analytics to UI components
This update is for those who use our UI components and want to avoid implementing as many analytics as possible.
UI components now have an option of firing analytics events automatically. FYI, loadmore
has always been fired automatically on album class
(Java: PXLAlbum, Kotlin: PXLKtxAlbum) when getting a list of photos.
However, for the analytics events such as actionClicked
, addToCart
, and conversion
, you still need to manually implement it.
Supported automatic Analytics events
PXLPhotoRecyclerViewInGrid (similar to Widget)
- VisibleWidget
- OpenedWidget
PXLPhotoRecyclerView (similar to Widget)
- VisibleWidget
- OpenedWidget
PXLPhotoProductView (similar to Lightbox)
- OpenLightbox
How to enable it?
PXLPhotoRecyclerViewInGrid
#!kotlin
// alternative: pxlPhotoRecyclerViewInGrid.enableAutoAnalytics(pxlKtxAlbum, "photowall") // newly added one
pxlPhotoRecyclerViewInGrid.enableAutoAnalytics(pxlKtxAlbum, PXLWidgetType.photowall) // newly added one
pxlPhotoRecyclerViewInGrid.initiate(...) // existing code, where you set up the photo list data and customize UI elements.
PXLPhotoRecyclerView
#!kotlin
// alternative: pxlPhotoRecyclerView.enableAutoAnalytics(pxlKtxAlbum, "photowall") // newly added one
pxlPhotoRecyclerView.enableAutoAnalytics(pxlKtxAlbum, PXLWidgetType.photowall) // newly added one
pxlPhotoRecyclerView.initiate(...) // existing code, where you set up the photo list data and customize UI elements.```
PXLPhotoProductView
#!kotlin
// set one of your region ids if you have.
val regionId: Int? = null
// alternative: pxlPhotoProductView.enableAutoAnalytics(regionId) // newly added one
pxlPhotoProductView.enableAutoAnalytics(regionId)// newly added one
pxlPhotoProductView.setContent(...) // existing code, where you set up the photo data and customize UI elements.```