Google Analytics and webOS

900 views
Skip to first unread message

Paul Canning

unread,
Nov 2, 2015, 9:33:57 AM11/2/15
to google-analytics-analyticsjs
Has anyone tried implementing GA with webOS?

I'd like to use the JS SDK in my webOS app, but I am unable to setup a property, because it's not a mobile app, and for website tracking (using the JS SDK), I need to enter a valid URL, but the app is not hosted.

Is there anyway I can use JS tracking, without the app being hosted on a valid URL?

NB - the webOS app is installed onto the LG Smart TV, and is a simple HTML5 + JS app.

Philip Walton

unread,
Nov 2, 2015, 11:56:22 AM11/2/15
to Paul Canning, google-analytics-analyticsjs
The website URL is not technically needed. Just put in something like example.com in GA.

--
You received this message because you are subscribed to the Google Groups "google-analytics-analyticsjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-analytics-ana...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-analytics-analyticsjs/8034670c-6232-4b0f-8173-7421537b4f8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paul Canning

unread,
Nov 2, 2015, 11:57:33 AM11/2/15
to Philip Walton, google-analytics-analyticsjs
Surely the analytics are only picked up if the URL is valid, and the data is sent from that domain to GA?
--
---------------------------------
Paul Canning
[ software artist ]
---------------------------------
[draw&code]  
digital creative studio

---------------------------------

Philip Walton

unread,
Nov 2, 2015, 12:00:59 PM11/2/15
to Paul Canning, google-analytics-analyticsjs
Nope :)

Instead of using the location option you can use the page option, which is just a path, so it's domain agnostic.

Paul Canning

unread,
Nov 3, 2015, 4:35:31 AM11/3/15
to google-analytics-analyticsjs, pa...@drawandcode.com
But doesn't the initial "ga('create', ...)" call need the matching domain as a parameter?

Basically, if I put in a URL of "www.exmaple.com" (or even a domain I own) for a Web-based Property, certainly GA is going to expect all hits to originate from there?

Philip Walton

unread,
Nov 3, 2015, 12:54:36 PM11/3/15
to Paul Canning, google-analytics-analyticsjs
Again, no, that's not how it works. Have you tried testing it yourself?

Not all hits to GA come from websites, so there's no domain or referral verification required.

On Tue, Nov 3, 2015 at 1:35 AM, Paul Canning <pa...@drawandcode.com> wrote:
But doesn't the initial "ga('create', ...)" call need the matching domain as a parameter?

Basically, if I put in a URL of "www.exmaple.com" (or even a domain I own) for a Web-based Property, certainly GA is going to expect all hits to originate from there?

--
You received this message because you are subscribed to the Google Groups "google-analytics-analyticsjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-analytics-ana...@googlegroups.com.

Paul Canning

unread,
Nov 3, 2015, 12:56:46 PM11/3/15
to Philip Walton, google-analytics-analyticsjs

I have been trying to test it, but either the RequireJS implementation I used is broken, or its OK and GA isn't picking anything up (was checking out real time stats but nothing showed).

Is there a quick way to determine if analytics have been sent/received and is working correctly?

Philip Walton

unread,
Nov 3, 2015, 1:09:43 PM11/3/15
to Paul Canning, google-analytics-analyticsjs

Paul Canning

unread,
Nov 4, 2015, 9:21:50 AM11/4/15
to Philip Walton, google-analytics-analyticsjs
SO, trying to run GA from my webOS app results in:

Executing Google Analytics commands. analytics_debug.js:9

Running command: ga("create", "UA-XXXXXXXX-X", "auto") analytics_debug.js:9

Creating new tracker: t0 analytics_debug.js:9

Error: type={0: "exc", 1: "create", 2: "SecurityError"} method= message= account= analytics_debug.js:9

Called method ""create"" threw exception: Error: SecurityError: DOM Exception 18 analytics_debug.js:9

I think this is possibly due to crossOrigin, as the app runs from file:// (as it is installed on webOS) and GA expects the anayltics.js to be sitting on a website.

Philip Walton

unread,
Nov 4, 2015, 1:23:12 PM11/4/15
to Paul Canning, google-analytics-analyticsjs
Ahh, yeah, I think there are issues with using file:// unfortunately.

Paul Canning

unread,
Nov 4, 2015, 4:19:36 PM11/4/15
to Philip Walton, google-analytics-analyticsjs

I did say from the beginning it was for webOS and installed on the device...

I found a library for GA for Chrome Extensions, could that be leveraged for webOS?

Philip Walton

unread,
Nov 4, 2015, 4:28:04 PM11/4/15
to Paul Canning, google-analytics-analyticsjs
I don't know anything about webOS, so you'd just have to try it.

Worst case scenario, you can use the Measurement Protocol to send hits, as all you'd need for that is the ability to make HTTP requests.

You can use the Hit Builder to test and validate hits before sending them.

Reply all
Reply to author
Forward
0 new messages