Google analytics mac os

Google analytics mac os

Note:

For Swift 5, Xcode 11.3 & Catalina Support and updated README, please check the ‘swift5’ branch. Thanks revblaze’s conribution.

Google Analytics for Mac OS X using Swift.

As we know, Google Analytics is perfect for user data collection and analytics. But unfortunately, there’s no official SDK for Mac OS X.

But still, there’re several ways to use Google Analytics on Mac OS X. MacGoogleAnalytics may be what you found.

Overall, there’re 2 parts work together to use Google Analytics.

  • This is the real place to send data to Google Analytics server. It uses Google Analytics’s standard JavaScript API.
  • In Mac OS X side, it loads the html file just mentioned. Send data like event to the html file as parameters. And then these data will be send in the html file through the JavaScript API.

You can find the html file in source > html > gapp.html .

Parameter of HTML File

The parameter of the html file is exactly the same with normal html file.

Demo of the html file with full parameters:

Here are the supported parameter list.

  • id
    • The Google Analytics id, e.g., ‘UA-12345678-1’.
    • Note: When you create a Google Analytics id, use the ‘Mobile app‘, but not ‘Website’.

  • name
    • The product name, e.g., ‘ihosts’ for iHosts. You can track different products using same Google Analytics id, even I don’t suggest you do that.
  • version
    • The app’s version, e.g., ‘1.2.1’.
  • ca (optional)
    • The Google Analytics event category name.
  • ev (optional)
    • The Google Analytics event action name.
  • la (optional)
    • The Google Analytics event label value.

Note: The full url include the parameters will be encoded. So no need to worry about the characters are valid or not. They will all be valid.

Deploy the HTML File

The html file should be deployed to a domain before it can be accessed. I deployed it at GitHub with my domain, you can feel free to use it.

You can also deploy it to your server with your domain.

Tip: you may want to reduce the html file size by compressing the JavaScript code in it. Thus it will be faster to download.

There’s only 2 files needed for Mac OS X part: GoogleAnalytics.swift and GoogleAnalytics.swift .

Good news is, you even don’t need to touch this file.

This is the key file to integrate with Google Analytics. If you read the code, you will find it in fact loads the html file in a WebView, and combine the data as parameters for the html.

This class help you easily use Google Analytics.

Don’t worry, you only need to update these properties:

  • GAID
    • The Google Analytics id, e.g., ‘UA-12345678-1’. This is the ‘id’ used as parameter of html file.
  • GAName
    • The product name, e.g., ‘ihosts’ for TODO iHosts Link. This is the ‘name’ used as parameter of html file.
  • PingURL
    • The full url of gapp.html, e.g., ‘http://atjason.com/MacGoogleAnalytics/gapp.html’ mentioned above, or the url you deployed.
  • PingTimeInterval
    • By default it’s 6h. It means telling Google Analytics every 6h that ‘hey, I’m alive’. This will help Google Analytics to calculate the active users.
Читайте также:  Manjaro linux пустой экран

Demo Project Using Swift

How to integrate MacGoogleAnalytics in your project? Just put the GoogleAnalytics.swift and GoogleAnalyticsHelper.swift in your project.

Then, you need to start Google Analytics when app finished launching, stop it when app will terminate.

The main usage of Google Analytics is to send event. How to send the event? Just as simple as following code.

When run your project with MacGoogleAnalytics, you may meet this error:

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app’s Info.plist file.

Apple disable http access by default for security reason. If you really need to use http, could manually allow it. Open Info.plist , and add the following lines:

Please keep in mind that this solution should be your last resort. You’d ideally want to enable HTTPS on your service, or next, whitelist domains on which you want HTTP and if none of this is possible, then use this approach.

Demo Project Using Objective C

View Data in Google Analytics Site

After data are collected, you can view them in Google Analytics as normal: https://analytics.google.com/analytics/web/. During debug, you can also check whether it works or not in ‘Real-Time’.

Just give a tip for OS X version. In the demo app using swift, it collect event of options > option_a > yes or no . You may want to know, how many users enable this option in OS X 10.10 and how many for 10.11. How to do it?

Open the Behavior > Events > Top Events , select options > option_a . Here you should be able to see all the events. Then add a new custom Segment, in Technology > Operating System Version , add contains ‘10.10’, save it as ‘OS X 10.10’. Add another Segment for ‘OS X 10.11’.

And then, apply the Segments, it could distinguish the data of OS X 10.10 or 10.11.

Release on Mac App Store

Yes, this way could be released on Mac App Store. In fact, these of my apps have already released on Mac App Store.

Show Your Product

If your product using MacGoogleAnalytics and you’d like to share it here, pull requests welcome 🙂

MacGoogleAnalytics is licensed under the terms of the MIT license. Just feel free to use it 🙂

If you think Mac Google Analytics is helpful for you, welcome to donate 🙂

Источник

Google Analytics for Mac OSx application

Is it possible to use Google Analytics API’s to track Mac OSX applications? If not could any one suggest me an alternative for Google Analytics.

4 Answers 4

Google Analytics is designed to work with web applications not for desktop apps. Although it might be possible to collect info about your application and send it to your Google Analytic account but the amount of work required to retrofit might be better spent, building your own Analytic solution.

Читайте также:  Nes emulator linux download

A good starting point would be to create a simple web service, which collects information regarding clicks. Then rewrite your application to call that web service on every click within your application.

You would ideally want to store this information locally and submit it to the web service in batches. You would also want to design the application, so that if you ever shut down the web service, the application would still be able to operate.

UPDATE: As pointed out in the comments by Václav Slavík, they have added apps analytics for iOS/Android.

I made a simple set of classes for doing this:

Google Analytics is not only for web applications, but also for mobile. It’s available on the platform like android, iOS, etc. If you want to track your MAC OS X application, you can choose DeskAppTrack or DeskMetrics. DeskAppTrack is only available on MAC. It provide a professional data statistical analysis and it’s free. While DeskMetrics is available on MAC and Windows. Either one is ok.

This really depends on how detailed you want to get. If you are are truly looking for analytics with detail and control flow data, you are better suited to created your own web service, as mentioned.

However, if you simply want to know a small number of operations, that occur at a small volume, i.e. when the app is launched (a quick and dirty solution): then in theory you could create a landing page on your site that contains a minimal head section, and a blank body, and then load the URL with an NSURL when you want to trigger the action.

Of course, you would have to include the google analytics tracking codes in the header, and you may need to load an off-screen webview to get the javascript to run. Like I said, quick and dirty.

In either case, you want to make sure the application will continue to perform properly, even if the web service / page is not present.

Источник

Analytics for Google Analytics 2.03 – Google Analytics app for Mac

Millions of people use Google Analytics™ to understand their website usage and to improve their business plans.

Unfortunately the Google Analytics™ website is neither easy to read nor to use. It fails to show the information that are really important.

With Analytics for Google Analytics we are proud to introduce the first powerful Google Analytics™-app for Mac. It makes viewing your Google Analytics™ data faster, easier and much more enjoyable than ever before.

  • Analytics for Google Analytics shows who your visitors are, how they behave, which devices they use, where they come from and much more. There are lots of different reports. For example:
    • Overview: Summarizes the most important data of today, yesterday, last week, month, year or every date range you can imagine.
    • Demographics: Countries, languages, visitor loyalty…
    • Device: Browser, operating system, device type…
    • Network: Social networks, traffic sources, search keywords…
    • Content: Top content, events, site speed…
    • Goals
  • Daily and hourly statistics
  • Date picker with date range presets
  • Double clicking shows details
  • Smart filtering
  • Powerful sorting options
  • PDF-export
  • Printing
  • Interactive world map
  • Multiple accounts and profiles
  • Stunning, interactive graphs
  • Outstanding user interface
  • bugs fixed
  • performance improvements
Читайте также:  Logitech webcam c250 windows 10

Источник

Analytics for Google Analytics 4+

Jan-Niklas FREUNDT

Снимки экрана

Описание

Millions of people use Google Analytics™ to understand their website usage and to improve their business plans.
Unfortunately the Google Analytics™ website is neither easy to read nor to use. It fails to show the information that are really important.

With Analytics for Google Analytics we are proud to introduce the first powerful Google Analytics™-app for Mac. It makes viewing your Google Analytics™ data faster, easier and much more enjoyable than ever before.

Highlights:
● Analytics for Google Analytics shows who your visitors are, how they behave, which devices they use, where they come from and much more. There are lots of different reports. For example:
— Overview: Summarizes the most important data of today, yesterday, last week, month, year or every date range you can imagine.
— Demographics: Countries, languages, visitor loyalty…
— Device: Browser, operating system, device type…
— Network: Social networks, traffic sources, search keywords…
— Content: Top content, events, site speed…
— Goals
● Daily and hourly statistics
● Date picker with date range presets
● Double clicking shows details
● Smart filtering
● Powerful sorting options
● PDF-export
● Printing
● Interactive world map
● Multiple accounts and profiles
● Stunning, interactive graphs
● Outstanding user interface

You must have a Google Account with Google Analytics™ to use this App.

Download the most powerful Google Analytics™-app today and dramatically change the way you monitor your Google Analytics™!

Источник

How can google analytics be integrated in a desktop application (MAC).

Could anyone help or refer how it can be done..I searched over the net and what i felt is that its only for mobile and websites.

4 Answers 4

It’s for websites. Many of the concepts of web analytics (number of pages viewed for example) don’t even make any sense on a desktop app, because they’re not organized like a web page.

If you want to use Google analytics data from an analytics account Google provides a data export API.

If you want to track your native application then as Catfish_Man (great name btw!) said, it is not really possible. That isn’t totally true, as you could fake it, but the paradigm is so different that you would be better off creating you own solution.

You might want to see this library for GA on desktops

Google Analytics doesn’t provide a native Mac app integration, but you can use the Measurement Protocol Overview to send raw data to your GA property from your account.

Just create a mobile app property and then start sending raw GA events using HTTP. There are couple Obj-C wrappers available like https://github.com/swisspol/GARawTracker or https://github.com/stephenlind/SimpleCocoaGoogleAnalytics.

Not the answer you’re looking for? Browse other questions tagged macos or ask your own question.

Linked

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.10.8.40416

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Источник

Оцените статью