We've designed a touchscreen "app" which is essentially just a webserver and set of html files running on a machine. However, the machines these apps run on are frequently offline - they store their actions and when back online send them to our server as a batch. We'd like to have google analytics for tracking users and their actions, including event times during the day. Is there any way to override the event time when posting to google analytics to force it to be the time our service has recorded for the event, rather than the time analytics received the event? I looked through the documentation but didn't see any way to override that. I suppose I could use a custom field(?) but it would be far more convenient if there was some kind of override.
Thanks
Related
How would I detect a Google Tag Manager publish event and send that to an external system?
I am trying to pinpoint effects of specific tag changes for certain properties and correlate them in a graph the way I might do with a new GitHub tag being created.
I've looked thru documentation but have not uncovered anything yet specifically for this scenario.
You could user container notifications to have an email sent to some service that processes the mail and stores the information.
Or you can use the API, retrieve the container fingerprint and compare it against a stored version of the fingerprint to see if it has changed. This would require you do implement some sort of polling in the API script to check every n minutes for changes.
I trying to find a better solution than google analytics to create dashboards for visually representing custom data.
My use case is that I need something to track and record custom data that is not passed in through custom web events into google analytics.
I was able to find a hacky solution to the problem initially by running a periodic function over my data on firebase and sending it as custom events to google-analytics. (I mention the approach in this answer. The linked blog post gives further details.)
The problem that I faced was that it wasn't always reliable as although the function did run successfully every day, the data was not shown in the google analytics dashboard.
The data I to visualize is gathered as further insights by writing basic code on existing data
I am aware that it is possible to integrate google analytics for various use cases like even the smallest button click, but I am trying to either send custom events( raised outside of the application by running cron jobs or scheduled functions ) through some API call or maybe directly save and update the data in some other place where there is direct access to visualization
Does anyone know a better solution?
The Google Analytics Measurement Protocol allows developers to make HTTP requests to send raw user interaction data directly to Google Analytics servers, so you can use it to send your data generate outside your application:
https://developers.google.com/analytics/devguides/collection/protocol/v1
I've recently set up Firebase Analytics with my website. I was beginning to add some events to be logged and realized any arbitrary event could artificially be called. I could just go into my browser's console and run the command firebase.analytics().logEvent('some_fake_event').
If you know a website is using firebase analytics, what's to stop you from simply spamming fake events into your console? The website owner's analytics would become fairly screwed up. Also, firebase mentions that there's a 500 event-type limit. One could also run firebase.analytics().logEvent('fake_event_1'), firebase.analytics().logEvent('fake_event_2'), etc. Oops, the website owner can't create any more new (legitimate) event types.
What is in place to prevent this?
The logEvent method will be available once you rely on standard firebase SDK. The only way to prevent this would be to obfuscate the library you're using.
I need to test some things with a Google Analytics View, but the default demo account that Google offers does not allow user to use the Analytics Reporting API :
You cannot use the demo account with the Analytics Reporting API. Attempts to do so result in a permissions error: (403) insufficientPermissions.
Source
I just need to replicate a view with different data already.
Thanks for helping.
You cannot replicate views with data. A view will always start empty.
However you can simply register a Google Analytics account and send lots of bogus data (either by setting up a web page with tracking code and call it repeatedly, or set a cron job to fire call via the measurement protocol) (this will happen in realtime, so you need to wait a few days before you have enough useable data. There is not way to bulk-create hits for a longer timeframe).
If you just want to test the API it probably matter that much what data you use, so a mock account should work just fine.
I have a question to the following case. We want to track a content platform using google tag manager. However, not every time the platform is online but GTM would send data to our internal server. Therefore our concern is if data collected during this offline period will be kept or if we loose them.
Do you know if there is some period during which data collected offline through Google Tag Manager is kept and once it gets online then it is sent to Google Analytics?
Thank you,
Lukas
No, that is not how Google Tag Manager works. GTM for web is basically a javascript injection engine. It bundles your configured tags,triggers and variables with a selector engine and injects that into your page. There is no serverside component that stores data.
I'm sure one could come up with a solution to your problem - e.g. store your data with localstorage in the browser, poll you server to see if it is available, and when it's online send the data with a queue time parameter to Google Analytics. However that has nothing to do with GTM.
Having said this, it is hard to understand your use case - if your server is offline, then where does the data come from ?
If you have an offline PWA app (with a Service Worker), you can use the Workbox Google Analytics module to handle the collection of data, and to report it upstream when your site comes back online.
This module has a service worker fetch handler that intercepts the calls that you would make with analytics.js or gtag.js, and stores your data locally in IndexDB in the event that the call fails because it is offline.