Add usage tracking
Usage tracking shows how your plugins are used: runs, dialogs, button clicks and crashes per plugin, user and PC. It works on its own or together with plugin login. This guide takes a plugin to its first event on the dashboard in about ten minutes.
You need a workspace. If you don’t have one yet, create it as in Getting started.
1. Copy the API key
Section titled “1. Copy the API key”Plugins send usage events with your workspace’s API key.
- In the sidebar, open API key.
- Click Generate key (the first key may already exist), then copy it. Keys start with
aut_.
The full key is shown only once. If you lose it, regenerate it (see API key).
2. Add the NuGet package
Section titled “2. Add the NuGet package”In the plugin project, add the tracking package. Use Plugboard.Tracking.Core instead for a
standalone tool that doesn’t run inside Tekla.
dotnet add package Plugboard.Tracking.Tekla.NET Framework projects default to C# 7.3, and the package needs C# 9 or later. Add this to the project file:
<LangVersion>9.0</LangVersion>3. Fill in plugboard-tracking.json
Section titled “3. Fill in plugboard-tracking.json”Build once. The build creates plugboard-tracking.json next to the project file (warning UT000).
Fill in the endpoint and your API key:
{ "endpoint": "https://api.plugboard.cloud/api/usage-events", "apiKey": "aut_your_key", "toolName": "Rebar Exporter"}The file is embedded into the DLL on every build. All settings, such as which events to send and whether to include plugin data, are in Configuration and events.
4. Wrap the plugin’s Run
Section titled “4. Wrap the plugin’s Run”Keep Tekla’s PluginBase (or DrawingPluginBase) and put the body of Run into
TeklaTracking.Run:
using Plugboard.Tracking.Tekla;
public override bool Run(List<InputDefinition> input) => TeklaTracking.Run(this, input, () =>{ // the plugin's work, as before return true;});For dialog and button tracking, call TeklaTracking.TrackDialog(this) in the dialog’s constructor.
See Tekla plugins.
5. See the first event
Section titled “5. See the first event”Build the plugin, copy it to your Tekla extensions folder and run it. The first batch of events is sent 5 seconds after the first event, then every 30 seconds.
Open Dashboard in Plugboard: the run appears under Recent events and in the charts. Nothing there? See Troubleshooting.
Next steps
Section titled “Next steps”- Configuration and events: choose events, plugin data, the override file.
- Tekla plugins: dialogs, buttons and drawing plugins.
- Getting started: let only allowed users open the plugin.