PowerTrack Data Format

Data dictionary

All Twitter APIs that return Tweets provide that data encoded using JavaScript Object Notation (JSON). JSON is based on key-value pairs, with named attributes and associated values. In addition to the text content itself, a Tweet can have over 140 attributes associated with it.

To learn more about these attributes and the organization of the Tweet payload, please read through our Data Dictionary documentation.

Matching rules enrichment

The Historical and Realtime PowerTrack products can have up to 1000 rules filtering the stream at any given time. When an activity is delivered, metadata is added in the “matching rules” portion of the activity to indicate which rule or rules caused that specific activity to be delivered.

If multiple rules match a single activity, the activity is delivered a single time with each of the matching rules included in this metadata. The matching rules provide an easy way to associate a specific activity with specific rules and customers in your product, even when you have many customers with lots of distinct rules.

Here is an example of the matching rules object:

"matching_rules": [{
        "tag": snowflake,
        "id": 907728589029646336,
        "id_str": "907728589029646336"
    }]

Rule tags

At the time they are created, each filtering rule may be created with a tag. Rule tags have no special meaning, they are simply treated as opaque strings carried along with the rule. They will be included in the “matching rules” metadata in activities returned. Tags provide an easy way to create logical groupings of PowerTrack rules. For example, you may generate a unique ID for a specific rule as its tag, and allow your app to reference that ID within activities it processes to associate a result with specific customers, campaigns, categories, or other related groups.

In the above ‘Matching Rules’ example, you can see that the rule that the tweet matched was tagged with the ID, ‘snowflake.’

Note that tags cannot be updated on an existing rule, but can only be included when a rule is created. In order to “update” a tag, you need to first remove the rule, then add it again with the updated tag. The best solution is to simply use a unique identifier as your tag, which your system can associate with various other data points within your own app, all without having to change anything in the rule set.