We are extending our analytic coverage to include actions on our Desktop apps for Windows and Mac OSX.
The Google Measurement Protocol is simple enough to use: https://developers.google.com/analytics/devguides/collection/protocol/v1/
Is there a way that we can extract the existing Google client-id, that is, the id generated by Google and generally stored in a cookie on the computer that uniquely and anonymously identifies the client?
For clarity - you would typically use Javascript to extract it in a web-page as follows; https://developers.google.com/analytics/devguides/collection/analyticsjs/cookies-user-id?hl=en#getting_the_client_id_from_the_cookie
How do you do the same using a language such as Swift or Objective-C on OS X, or MFC/C++ on Windows.
The client id is generated by the Javascript tracking code (or the SDK respectively). So if you use the measurement protocol there is no pre-existing client id that you could extract.
The good news is that you can generate your own. Google Analytics isn't critical w/r/t what it accepts as client id, any string will do - however to serve it's intended purpose it must be unique, so a UUID is recommended.