Preparing test data

To prepare report test data, run any report by going to the Reports menu item at the top, then click + New Report at the top right of the page.

Depending on what kind of plugin input data you've selected in step 2, you can use one of these reports:

  1. Timerseries as plugin input data — Any report will work here, such as User Report. If not already available, click Add Item and select User Count. Then at the top right make sure the time unit corresponds with the time unit your plugin can handle. Then pick a long enough date range like Last 180 days and then Run Report.

  2. List of users as plugin input data — All report types work here, but usually you would want to use the User Report or Custom SQL report. Let's say we're making an AB-testing plugin. Click Add Item in the report and select Event count and then the event you want to count conversion for is used to distinguish between converted users. This value is normally specified by the end-user via a Plugin input data variable of type number that you would add — a placeholder for the number of conversion events a user had.

    Then at the top right make sure the time unit is set to Total. Next you always need to add to Group By the User -> ID field — this makes sure the data is recognized as a list of users. You can then add any other Group By such as AB test variation so that we can distinguish between the group of users and the AB-test variation they are in. Finally pick a long enough date range like Last 180 days and then Run Report.

    This is a bit of a convoluted way to get a list of all users. A better way would be to use a Custom SQL report and then query the users table directly. This allows for more fine-grained filtering.

    Usually both cases are fine though, as a List of users plugins are normally not being run directly by the end-user, but abstracted away in an Insight. The Insight could for example ask what user property contains the A/B test variation; this will then be used in a dynamically built Custom SQL query through the Insight API. If you want to go that route, you need to first build your test data through a Custom SQL report, and for real usage you would create a custom SQL query via the Insight API to supply your plugin with data. See Insight API — Custom SQL for details, once you're ready to use your plugin in the Insight API.

  3. List of events as plugin input data — Only the Event report or the Custom SQL report work here. Let's say we're making an Anomaly detection plugin. Click Add Item in the report and select User count — this will not be used but we need at least one report output item.

    Then at the top right make sure the time unit is set to Total. Next, you always need to add to Group By the Event -> Any event -> ID of event field — this makes sure the data is recognized as a list of events. In addition you also need to add to Group by the timestamp of the event by picking Event -> Any event -> Created at date and time -> Date, as well as the name of the event from Event -> Any event -> Name. Finally pick a long enough date range like Last 180 days and then Run Report.

    This is a bit of convoluted way to get a list of all events, especially since we cannot filter by event name to limit the amount of data returned. A better way would be to use a Custom SQL report and to query the events table directly. This allows for more fine-grained filtering.

    Usually both cases are fine though, as List of events plugins are normally not being run directly by the end-user, but abstracted away in an Insight. The Insight could for example ask what event the user is interested in terms of anomaly detection; this will then be used in a dynamically built Custom SQL query through the Insight API. If you want to go that route, you need to first build your test data through a Custom SQL report, and for real usage you would create a custom SQL query via the Insight API to supply your plugin with data. See Insight API — Custom SQL for details, once you're ready to use your plugin in the Insight API.

Additionally you can also add extra Segments, Group By or Date Ranges to your report. This will make sure you can handle those if the end-user uses those. For example you can allow your forecasting plugin to make a forecast per country if that was added in Group By.
This will be used mostly in Timerseries input data plugins, as the end-user would want to see the plugin results from different angles, such as between several countries. List of users or List of events will typically not be run directly be end-uses on the of reports, so there will be no need to support multiple Group By, Segments or Date ranges.

Once the results are in, click the Plugins dropdown and select your plugin. You will get a popup with two keys that you have to write down for later — the Project key and Dataset key.