Do firebase dynamic links work with PWA applications? - firebase

Firebase dynamic link documentation does not show Web as a category it supports but I wanted to know if there is any hack out there where can get it to work for PWA applications? the google analytics tracking for firebase is a powerful feature, especially for dynamic links.

Even though there is no specific API for this, since Dynamic Links are just URLs, you can indeed use then within a web app.
For example, we used them in the PWA for the Firebase Summit in 2018 to track click-throughs to the additional information for each session.

If you are having issues with your PWA not running correctly in Facebooks (insert expletive) Mobile Browser. Using dynamic links will force it out to the regular browser)
Do not use a custom domain, use the https://YOURDOMAIN.page.link
and DO NOT skip the preview page!

Related

Google Signin with Firebase Auth on Android Cordova not working

I spent hours trying to make Google Signin work on Android with Cordova (it was working on iOS / Web). I have followed these instructions: https://firebase.google.com/docs/auth/web/cordova
I was trying to use a custom Dynamic Link ("mydomain.com/link") and it was not working: after authenticating, the user was redirected to the website INSIDE the popup, instead of closing it and authenticate in the app.
So I decided to create a simple "myapp.page.link", but it was not working neither.
Finally, I simply deleted my custom Dynamic Link, and voila, it works!
So you can use a custom domain for the AUTH_DOMAIN, but not for the DYNAMIC_LINK_DOMAIN. Important: if you use a custom AUTH_DOMAIN, you will have to change manually the authDomain attribute in the firebase config of your app.
#Firebase team: I think it could be useful to update the doc to precise that:
you cannot use custom Dynamic Link
you cannot have several Dynamic Link active
And ideally, it would be ideal to explain how the Dynamic Link is used by Firebase Auth: I followed the explanation, thought that any dynamic link would do the trick, but since you do not explain how it works, it's extremely hard to guess that it is not the case, and that having several dynamic links can be an issue.

Wix template sending tracking via fileusr to my site - causing Google Analytics to view traffic as referral

My website is hosted on wix.com . Wix does not allow you to insert HTML code directly in the page of your web site. When I input HTML code, Wix inserts an iframe that is hosted from a different domain (filesusr.com). This iframe does not use Google Analytics tracking, so when the browser loads this iframe GA believes my customer has "left" my web site and gone somewhere else. When the iframe loads, the original source of the traffic is lost.
From the research I've done, it seems this Wix feature does not work with GA traffic tracking, and so there is no solution other than using a different hosting platform.
However, I'm sure you clever folk know otherwise!...
Right, Wix is notorious for being a "widget" based platform that does not play nice with custom code. However, the whole GA different-origin thing is such a common request that they implement the tracker directly themselves if you plug your GA ID into your site settings. Any reason you are not using this? - https://support.wix.com/en/article/adding-your-google-analytics-tracking-id-to-your-wix-site. They also claim to support other custom tracking snippets - make sure you are pasting it into the "Tracking & Analytics" section and not as a custom HTML widget.
If for some reason you can't or don't want to use the above methods, it used to be that you were just out of luck. There is a reason why Wix is not as favored as other platforms by digital marketers that need to implement tracking code. However, if you were really determined, you could probably implement a very custom GA tracker or any custom code through their new feature called Corvid, which exposes internal APIs and extra coding features. How to do so is beyond the scope of this question, but the postMessage() method is the normal way to pass messages from a parent to a child (iframe) container. Or you could use wix-fetch, which is an internal version of the web API fetch(), to manually send a hit request to GA.

Firebase Dynamic links Analytics not shown?

I am exploring the dynamic links in firebase. My requirement is I will have an sms in my cell phone, which will have a short link and upon click of this link I will open a web page (later we might integrate this with a page in the app)
So I created fire base account and setup an app using my personal gmail account.
Am using their post api with the right api key to generate short urls. (getting warning about the phishing issues which I am ignoring for the time being)
Upon clicking the urls (short link/preview link) I can go to the appropriate URL I have configured.
now I am trying to see the analytics around this dynamic url but dont know why I cannot see anything.
I am checking Grow -->DynamicLink--> Selected My app and I expect the dynamic link generated in above steps to appear here but I cannot see anything.
I am going to analytics -->Events it is asking me to add an app to see the analytics which is not the case for now as I am just hitting the url on the browser directly.
Please let me know if I am doing the right thing?
One of the main use cases (as mentioned in firebase docs) of the firebase dynamic links is web to app conversion and your app must contain the firebase SDK. Once the user comes to the app through the dynamic link, firebase SDK fires the appropriate events. These events can be tracked from analytics -> Events.
But your use case is different you are creating dynamic links for the SMS and after clicking user comes to the website and there is no firebase SDK installed in your website hence no analytics (although firebase will measure some events like click, etc) on the analytics -> Events.
If you want to see the analytics, you will need to create a dynamic link in the firebase console manually or use the dynamic link analytics api.
In short, API created dynamic links can only be tracked if firebase SDK is installed in your app and after that, you need to add that app to firebase analytics -> events section. According to your use case, my suggestion would be to either create dynamic links from console manually or use the dynamic link analytics api

Tracking mobile web app with Google Analytics using the website script

I have built a web app (read: a website within a naitive app container) for iOS and Android. I started by adding the website script provided by Google to my app, figuring it would work since it's basically a website hosted within a container. The issue? Well, it doesn't work.
When I access the app from my phone, all I get within the Analytics GUI is that there is a user at page / nothing else despite how many pages I go to. I get the same result if I just browse to the website on my phone. However, if I go to the website on my computer, the script seems to pick up everything perfectly. I can see all pages I've visited and when, for example.
So I guess I have two questions:
Why doesn't the script work as expected through the app on my phone, but perfectly when accessing the webiste on my computer from a technical point of view? Does Google perform some sort of blocking regarding the request headers?
Is there any way to get the website script to work within an app or do I have to use Firebase for long-term and sustainable tracking?
Have in italics since the feeling I get when reading here is that the Google Analytics Services SDK for Android and iOS will probably be phased out sooner or later. According to this post the GA SDK is already deprecated. So using that doesn't really feel like an alternative.
Also, I am not interested in comments like "Why don't you use this analytics tool instead", or, "What's your problem with Firebase? Just use it".
There are two types of Google Analytics accounts. Web accounts and mobile accounts. Web accounts run off of pageview hits. Mobile accounts run off screenview hits. If you insert a screenview into a web account the only thing you will see is page / because its sending the in correct hit type.
The SDK is used for tracking mobile applications so it inserts screen views. You cant use the same Google analytics account for tracking with it your going to need a mobile Google analytics account if you want to use the SDK. You wont of course be able to analyse between the web and mobile accounts.
Cant help with firebase sorry.

google analytic technical: gif request & options for web apps

I want to build own analytic platform base on google analytic (GA).
So I had a quick investigation on GA.
But I have some misunderstand below:
In the website and web apps field, google analytic give three options: gtag.js, analytic.js, AMP HTML. But I don't know what will I choose whichever. or could you help me point out the case that we will use for each option?
I tried to follow gtag.js, debug and realize that google analytic send a gif request to post data to google analytic server. I think they use this way to avoid cross-domain Ajax. But the question is how they send data to google server by Android/IOS sdk? They still used gif request or normal restful api.
If anyone know or have idea please help and sharing to me.
Thanks in advance
Jame
gtag.js (global tag) is the current version of Google tracking code - "global" because it aims to provide a unified tracking code for Analytics, Adwords, and other Google products.
With the release of the gtag libary analytics.js is now the legacy version of the Google Analytics Javascript tracker, so currently most available information refers to that. However if you are getting started with Analytics you probably should use the current version.
AMP are accelerated mobile pages, a special format with reduced markup and scripting options that is cached on and delivered from Google servers (you relinquish control over your pages in favour of faster delivery, basically). If you have to ask what this is then you are not using it, and do not need this type of tracking code.
If you use Google Analytics in a mobile website you'd use the Javascript tracker and that will indeed return a gif.
If you want to track a native App you would, these days, use Google Analytics for Firebase which comes with it's own SDK. You would implement Firebase in your App and then connect the Firebase project to a mobile property in GA.

Resources