trigger.io — Google Analytics - javascript

How does one go about including Google analytics for Trigger.io-built apps? I can see that the mobile web built with trigger.io would be just a matter of embedding the GA JS code. But what about iOS or Android?

We have integrated the Flurry Analytics SDK as of our v1.4.19 platform release. Documentation available here:
http://docs.trigger.io/en/v1.4/modules/flurry.html
It is also possible to integrate the Google Analytics native SDK (or any other analytics SDK) using the plugin system.

Simple answer:
You already answered your own question - embed the Google GA JS code.
Alternative answer:
Another alternative is that you could utilize forge.ajax and fire the .trackPageView method in the success callback. In this case you would have to add the proper domain permission in your config file.
However, isn't GA tied to a specific domain (or group of domains)? In the case of PhoneGap or trigger.io there is no domain name.
Also, see this question & answer -
Step by step to get Google Analytics working in PhoneGap 1.2.0 on iOS (phonegapalytics)

Embedding the JavaScript version of Google Analytics won't work - for some reason, the tracking calls don't fire any events, so you need to use the measurement API.
I've created a plugin that allows you to use Google Analytics with Trigger.io on github, which you can use: http://bit.ly/1F3VM1J
The plugin uses the Request and Prefs module to send analytics data to Google, and it works with the realtime dashboard too. You can track screenviews and events only at the moment, but it should be sufficient for your application.
To track a pageview, you can do the following:
// send screenview tracking data
ga('send', 'screenview', 'App Load');

Related

Confused about Web share API and Cordova share plugin

I'm trying to implement a share feature in my Cordova app to let users share their pictures
According to the Chrome dev team they introduced a Web share API directly into Google Chrome. To share something just call:
navigator.share({title: 'Example Page', url: 'https://example.com'});
but as far as I know Cordova also has a plugin, namely cordova-share-plugin
To use this plugin, simply call:
navigator.share(text,title,mimetype)
This is where I get confused. Both the built-in share API and the Cordova plugin have the same method navigator.share(). The expected parameters are different.
If I have installed the cordova share plugin and I call navigator.share() which code get executed? the plugin or the native share API?
It looks like one of my user is unable to share pictures because the call to navigator.share() fails silently. He has Android 8.1.0. All the other users seem to trigger the Cordova plugin when my app calls navigator.share()
That's a pretty old plugin, created when navigator.share was not available in the browser.
The plugin clobbers navigator.share, so it will use the plugin implementation instead of the browser implementation.

Mobile live geolocation

Im trying to get my Iphones live location to show on a map on my website.
Is there a way to acomplish this easily using HTML5 Geolocation or is it better to use Google Maps Geolocation API, or some other library?
Thanks.
I use Google Maps Geolocation API in WEB APP developed with .NET C #
And it was great
At HyperTrack we have an SDK which you can plugin to your app in as little as 3 lines of code and automatically enable location tracking in your application and view (for free) on our Dashboard. In our Sandbox mode (read: Test Mode) you can track and assign actions for up to 20 users for free as well. This mode also gives you an Action Widget that you can embed anywhere to see the activity of your user(s)/device(s).
For iOS you can visit our iOS Integration Guide.

How to use OAuth with Facebook in a Safari App Extension

My question is similar to How to use OAuth with Github in a Safari extension, however, the answer there explains how to use oauth with the older safari extension API. I am trying to use OAuth with the new Safari App Extension API (https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/SafariAppExtension_PG/).
The new API allows the writing of native code, in addition to providing the ability to inject content scripts. Where should I perform the authentication? I also developed a chrome extension, and Google provides an API for retrieving OAuth tokens (https://developer.chrome.com/apps/identity) -- however I do not see anything similar for Safari App Extensions.
Any help is greatly appreciated!
I am currently working on Safari App Extension similar to your needs and the logic, certs (if you use them) persistence, access and refresh tokens all of them goes to the native code. From the SFSafariExtensionHandler you can control the active window/tab and all the pages in the tab, also receive callbacks from the pages.
For the OAuth use any native lib. that solves most of your needs for the logic. I am using this one from AeroGear.
Some adaptation will be needed for the page controlling.

How to get Google Drive API example to run in Phonegap application (support for Android)?

I have successfully been able to use the example provided for the Google Drive API to authenticate and get files & folders of a user's Drive (https://developers.google.com/drive/web/quickstart/quickstart-js).
But I need to convert this example to be able to launch on an Android device using Phonegap. When I run the Phonegap application I get the following error:
Refused to display document because display forbidden by X-Frame-Options.
I have had a look at some answers for dealing with this error for other applications such as including SAMEORIGIN for X-Frame-Options in the meta tag and running the application in the emulator to see if it works but it does not. I have also made sure that the inAppBrowser plugin has been added.
Note, I am using localhost to test the application. I'm not sure if this will cause an issue.
I'm not sure how to solve Google Drive authentication in a Phonegap application.
I'm not sure what your issue is at this point, nor what you are ultimately wanting to do with your app. Consider looking at Filepicker.io as a PhoneGap integration point for Google Drive. Filepicker.io Home Page and the github repo for the plugin

Setting up Android application for Analytics and tracking

Tracking events and setting up Analytics for Websites seems easy. You create an account with one of the Analytics service providers like Google. They give you javascript code that you embed in your pages (whichever event you wish to track) and voila..you're done.
I have written a native application for Android phones, which is actually an adaptation of the actual web site. Now, I am required to setup Analytics and tracking for this native application.
Question:
How to do setup a native application for Analytics?
We have Java Script code(not Google Analytics but for some other engine) that works for the original web site. Is there a way to incorporate that in the native application?
I know Android supports Java Script via WebViews(Webkit);my application does not have webviews, it is native!
I have not worked on JavaScript since school so excuse me if I sound naive.
Thanks.
Google Analytics provide a guide for implementation on a mobile device.
Refer to http://code.google.com/apis/analytics/docs/tracking/mobileAppsTracking.html
To get started have a look at this guide from google.

Categories

Resources