Skip to content
This repository was archived by the owner on Jul 15, 2021. It is now read-only.

Facebook Shares

Aaron Schachter edited this page Apr 4, 2019 · 1 revision

Context

We have been providing a way for users to take action on our campaigns by sharing content. When we launched these new actions, we tracked the data of who did what in our analytics platform.

They have proven to be successful action types, we want to be able to export the data we have collected into our campaign activity service so that they can be track as actions throughout our systems, and so we can serve this activity via the API for other apps to use.

Problem

The data that we recieve from the analytics tracking we have been doing is not in the same schema as post data. We want to figure out how to store these share "posts" into our campaign activity service.

Solution

Analytic Data Model

{
    "event.name": "completed_share_facebook",
    "page.path": "/us/campaigns/give-spit-about-cancer/action",
    "type" : "facebook",
    "action" : "quiz-share",
    "user.northstarId" : "59ba9xxxxxxxxe564f",
    "keen.created_at" : timestamp,
}

The data model above needs to be transformed into a post in our campaign activity service.

Note: When importing these into our campaign activity service from a CSV we will ignore any records w/o account IDs.

Campaign Activity Post

{
    "id" : 3,
    "signup_id" : 1234,
    "campaign_id" : 34567,
    "northstar_id" : "59ba9xxxxxxxxe564f",
    "type" : "share-social",
    "action" : "quiz-share",
    "quantity" : null,
    "url" : null,
    "text" : null,
    "details": {"platform": "facebook", "_id": "5b201dfdeb77630004790a85"},
    "status" : "accepted",
    "source" : "importer-client",
    "source_detail" : { "original-source" : "phoenix-next"},
    "created_at" : keen.created_at,
    "updated_at" : "timestamp",
    "deleted_at" : null
}

Full conversation on how the above was decided in this issue.

Clone this wiki locally