To do:
- Review the accuracy and completeness of https://wikitech.wikimedia.org/wiki/Metrics_Platform/JavaScript_API
- Ensure that code samples work, are consistent within the page, and reflect development best practices
- Make any required changes directly to the wiki page
Questions:
- Assuming that any instruments using the base schemas and the monotable streams must provide an instrument name, I suggest that all examples in the docs use Instrument. That way we can avoid the complexity of presenting different methods of using the API, especially since the DRYness of using Instrument is a better developer experience. What do you think?
Looking at the code, it seems that the submitClick and submitInteraction methods will accept any InteractionData fields as long as they validate against the specified schema. I've opted to document this functionality as-is in the docs instead of recommending a specific set of interaction data fields. This way we can use other sources (like the instrumentation spec instructions) to provide guidance about which interaction data fields to use. Let me know if you'd prefer to be more prescriptive in these docs, and I can add back the list of recommended fields.Is there any way to test the code samples in the docs automatically?