I have in my widget a few buttons and I want to track clicks.
Is this possible or even allowed by Apple? I'm have been looking for information but can't find any.
It's really simple. In the navigator panel of your containing app select libGoogleAnalyticsServices.a file and in File Inspector check it for your extension target:
I did it for libAdIdAccess.a too and for all frameworks needed for GA:
Next go to viewDidLoad of your Widget ViewController and do an ordinarily implementation for GA SDK: import headers, init tracker, send events. You can immediately check how it work in Real-Time section of GA interface.