Skip to content

Instantly share code, notes, and snippets.

@alexanderdean
Forked from anonymous/itemViewTrack.md
Created December 17, 2012 16:03
Show Gist options
  • Save alexanderdean/4319428 to your computer and use it in GitHub Desktop.
Save alexanderdean/4319428 to your computer and use it in GitHub Desktop.

itemViewTrack

Details

Reference: snowplow/snowplow#113
Idea from: https://github.com/kingo55

Summary

This is a new feature to track views of products on ecommerce sites, or suggested articles on a media site, similar to how Google AdWords tracks ad views in different positions on a page.

Tracker specification

Add a new method trackItemView() like so:

Parameter Required? Example value
SKU / item code Yes 'pbz0001234'
page context Yes 'category page'
item name No, but advisable (to make interpreting SKU easier) 'Black Tarot'
item ranking No 4
item location No 'div-cat-4

Item views are a new event type:

  • Added to the tracker protocol as &e=iv
  • Fields in tracker protocol prepended with iv_

Example:

  _snaq.push(['trackItemView',
    'business-20752215', // SKU/item code - required
    'RelStoriesFooter',  // page context - required
    'Japan elections: Shares rise and yen weakens on Abe win', // item name
    3,                   // item ranking
                         // item location (not set)
  ]);

ETL, Storage specification

  • Each item view becomes a single event in SnowPlow
  • All fields are extracted into new fields in Hive/Infobright. No enrichment is required - all fields are just passed through
  • The event field will be set to item_view

Roadmap

  • Extend trackItemView so it can use the 10 custom var slots for events, and the cv_json custom var slot for a JSON (waiting on SnowPlow custom vars implementation)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment