workingwithdata_ebook_april21_awc2op 4

28.04.2021 Views

TREATING DATA AS A PRODUCTWhat this could look like in practiceWe can define what the events coming to your data warehouse look likebefore they are even sent by writing a set of rules. For example, the ruleset fora click event:{"element_name": {"enum": ["share","like","submit_email","rate",..."close_popup”],"description": "The name of the element that is clicked"},"value": {"type": ["string", "null"],"description": "What is the value associated with the click"},"element_location": {"type": ["string", "null"],"description": "Where on the screen is the button shown eg.Top, left"},"click_error_reason": {"type": ["string", "null"],"description": "If the click resulted in an error, what wasthe reason eg. Invalid character in text field"}}37

TREATING DATA AS A PRODUCTPrior to loading the data to your warehouse, each event is checked to see if itconforms to the rules laid out. There are two ways of doing this:• If you are using a 3rd party data collection vendor such asGA – validate client side• If you have 1st party data collection such as a home-built pipelineor Snowplow – validate in the data collection pipeline, prior towarehouse loadingEither method means the structure of data in the warehouse is controlledstrictly by those consuming it.Subset of properties sentautomatically for every eventCustom properties of the click eventUser ID Platform Timestamp EventNameElement_name Value Element_location Click_error_reasonJoeWeb2019-10-0112:33:21Page_viewJoeWeb2019-10-0112:33:29Click submit_email joe@email.com homepage_footerJoeiOS2019-10-0123:31:03Click rate no_rating_selectedWith this simple change to the setup of introducing an enforced ruleset, yourfront-end devs can finally QA your analytics in the same way as they wouldQA the rest of any build, by adding to their integrated testing suite usingsomething like the open-source tool Micro.38

TREATING DATA AS A PRODUCT

Prior to loading the data to your warehouse, each event is checked to see if it

conforms to the rules laid out. There are two ways of doing this:

• If you are using a 3rd party data collection vendor such as

GA – validate client side

• If you have 1st party data collection such as a home-built pipeline

or Snowplow – validate in the data collection pipeline, prior to

warehouse loading

Either method means the structure of data in the warehouse is controlled

strictly by those consuming it.

Subset of properties sent

automatically for every event

Custom properties of the click event

User ID Platform Timestamp Event

Name

Element_name Value Element_location Click_error_reason

Joe

Web

2019-10-01

12:33:21

Page_view

Joe

Web

2019-10-01

12:33:29

Click submit_email joe@email.com homepage_footer

Joe

iOS

2019-10-01

23:31:03

Click rate no_rating_selected

With this simple change to the setup of introducing an enforced ruleset, your

front-end devs can finally QA your analytics in the same way as they would

QA the rest of any build, by adding to their integrated testing suite using

something like the open-source tool Micro.

38

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!