Pocket / extension-save-to-pocket

Save to Pocket is a browser extension that is used to save pages to a connected Pocket account
https://getpocket.com
MIT License
278 stars 49 forks source link

story(analytics): tagging analytics - add contextual info #120

Closed nelsonomuto closed 5 years ago

nelsonomuto commented 5 years ago

Expected Behavior

For both chromium and safari 12 browsers. We should be sending contextual data along with the request to add tags in an actionInfo parameter.

                var actionInfo = {
                    cxt_ui: 'popover',
                    cxt_view: 'ext_popover',
                    cxt_url: sender.tab.url,
                    cxt_suggested_available: request.analytics.cxt_suggested_available,
                    cxt_enter_cnt: request.analytics.cxt_entered,
                    cxt_suggested_cnt: request.analytics.cxt_suggested,
                    cxt_remove_cnt: request.analytics.cxt_removed
                };

Similar to how the legacy extension repo had it as outlined here: https://github.com/Pocket/Extensions/blob/04e280e3999beb5e63365e8d9b5a8294c520ef25/src/app/background/background.js#L507-L519

Safari Swift API

For safari 12 this may need to be updated in the swift layer. @collectedmind

Actual Behavior

Currently this context info is not being sent with the request to add tags, we are only sending a bare bones object with the tags to be saved

{
    "actions": [{
        "action": "tags_add",
        "item_id": "989233",
        "tags": ["aa", "fad"]
    }]
}

legacy safari

For tag_added actions being sent from the Safari extension, I see some context data on those actions that I would like help interpreting.

-cxt_suggested_available = # of suggested tags the user saw on that item when they went to add a tag -cxt_enter_cnt = # of tags they added to the item -cxt_suggested_cnt = # of the tags they added that were suggested tags -cxt_remove_cnt = # of tags they removed -cxt_premium_status = 0/1 depending on if user is a premium user https://pocket.slack.com/archives/C1D0DKFLL/p1566508132005900

Steps to Reproduce the Problem

  1. Save an article to pocket
  2. Add a tag
  3. Verify the network request parameters in the devtools or a tool like Charles Proxy POST getpocket.com/v3/send/

Specifications

audie1 commented 5 years ago
Analytics QA Report (Production) | Mode 2019-09-23 13-35-14
audie1 commented 5 years ago

I'm seeing the correct values arriving for the add_tags action as they are logged here...

https://docs.google.com/spreadsheets/d/1hO1z5H0PzZkPjjUWK_RYaXS-KO9QcxCNhWpOdQPrh7Q/edit?usp=sharing

Looks like this is fixed!

audie1 commented 5 years ago

@nelsonomuto looks good