totersapp / asana-integration-test

0 stars 0 forks source link

try to capture (and display) empty shopping cart data using analytics, rather than via api call #17

Open abbood opened 5 years ago

abbood commented 5 years ago

Business Value Added

move the logic of tracking incomplete carts to analytics rather than backend/api calls to relieve overhead and complexity

Analysis

currently, whenever a user goes to a checkout page, we create an order object, which is later used for marketing to track incomplete carts.

you can see this information in the incomplete cart page on admin: !Screen Shot 2017-11-14 at 7.53.21 AM.png|thumbnail!

API call

the incomplete cart page calls api/orders?page=1&statuses%5B%5D=incomplete_cart which returns this json .

we must at least explore the possibility of getting this information from analytics.

Current usage of analytics

!Top Events - Analytics 2017-11-13 14-46-18.png|thumbnail!

iOS

see ?fileviewer=file-view-default#ItemViewController.m-231:237 here

    id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];

    [tracker send:[[GAIDictionaryBuilder createEventWithCategory:delegate.selectedStore.store_name
                                                          action:@"visit"
                                                           label:[NSString stringWithFormat:@"%@",_item.ref]
                                                           value:nil] build]];
    }

Android

see ?fileviewer=file-view-default#ItemDetailsActivity.java-224:230 here

                try {
                    Log.i("Analytics", "Setting screen name: "+selectedStore.getRef());
                    mTracker.setScreenName(selectedStore.getRef());
                    mTracker.send(new HitBuilders.EventBuilder()
                            .setCategory(selectedStore.getRef())
                            .setAction("visit")
                            .setLabel(item.getRef())
                            .build());
                } catch (Exception e) {
                    e

References

  1. screen tracking
  2. event tracking
  3. ray wenderlich tutorial