Track your Delphi/Pascal GUI application with Google Analytics

What is SoftMeter?

Quick answer: SoftMeter is "Google Analytics for desktop applications".

Longer answer: Google Analytics (GA) is the most popular website statistics tool. It shows statistics about the visitors to your website. GA can also track Firebase mobile apps.

SoftMeter application analytics and statisticsSoftMeter is a very small software library that extends the coverage of GA to include desktop applications (Windows and MacOS), and mobile apps (IOS iPhone and iPad).

By including SoftMeter in your software you will be able to see how users around the world use your application, just like you monitor visitors' traffic on your website.

If you are a shareware developer using Delphi or Lazarus, you can link the application analytics, SoftMeter DLL with your software and see the usage statistics in Google Analytics, for free.

SoftMeter is an API client for the Google measurement protocol. It connects any desktop application with the Google Analytics reporting platform.

You wil thenl be able to see some key metics for your distributed software product, like the ratio of the free installations vs the paying users of your shareware and be able to understand the conversion bottlenecks.

SoftMeter provides usage statistics like:

  • Installs vs uninstalls.
  • Users' countries and prefered languages.
  • Operating systems and screen resolutions.
  • Active installations.
  • App versions and editions (e.g. Free vs Paid)
  • Most and least used features of the program
  • Crashes and exceptions

The implementation is kept very easy. You can complete it in a few hours (together with the setup of the Google Analytics property), and start seeing real-time and historical data of your software's usage around the world.

In your Delphi project you will need a new unit to hold the global object of the SoftMeter class. You will use this object from various places of your software to send hits to your Google Analytics property.

A minimal example of the new unit: "softMeter_globalVar.pas"

unit softMeter_globalVar;


uses dll_loaderAppTelemetry;

// this is the global variable that multiple units of the application will use
var dllSoftMeter: TDllAppTelemetry;


  userGaveConsent:= true; // make sure you load this variable from the user settings
  dllSoftMeter := TDllAppTelemetry.Create(DLLfilename);
  dllSoftMeter.start(AppName, AppVersion, AppLicense, AppEdition, GooglePropertyID, userGaveConsent );


If you have a base form that all other forms inherit from, add the tracking code in the base form.

It would be good to add an "Enable analytics" form property so that you can disable the tracking of non-important forms. Reducing the google analytics hits, allows you to focus on the important hit sequences.

A minimal example of the base form:

procedure TBaseForm.FormShow(Sender: TObject);
  // send a pageView hit on Form Show, taking the current classname and caption
  dllSoftMeter.sendPageview( PAnsiChar(Classname + '/ ' +  Caption ),  Caption ); 
  // or send a screenView
  dllSoftMeter.sendScreenView(PAnsiChar(Classname + '/ ' +  Caption ));

If you have important button clicks that you want to track, e.g. click on the "buy now" or the "Donate" button, you can send event hits.

A minimal example of sending event hits:

procedure TForm1.Button1Click(Sender: TObject);
  dllSoftMeter.sendEvent('Conversion events', 'Donate clicked', 1);

You can see the full Delphi GUI application example at our Github page.

After implementing SoftMeter with your Delphi software, you can log in to Google Analytics and see reports and graphs like the following:

shareware report on active installations

real time users in Google Analytics


I did not understand this line:
"If you have a base form that all other forms inherit from, add the tracking code in the base form."

Have a sample?

You can create a


and like the example above put the SoftMeter event inside the



Then, all your other forms should inherit from TBaseForm. E.g.

TMyApplicationMainForm =  class(TBaseForm)
TMyDialogForm =  class(TBaseForm)

When the forms become visible they will send a hit with their caption to your analytics reports.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

plain text with line breaks

  • Allowed HTML tags: <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <br>
  • No HTML tags allowed.
  • Lines and paragraphs break automatically.