simple google analytics way to count node.js site visits - node.js

I have a node.js website and I seek a simple way to know if anyone is visiting it. I have google analytics 4 on my google account panel (I created that account with google), and I want my node.js website to report site visits to it (like people are doing with Wordpress).
In short, I want to go up to my google analytics panel on google and view the site visits (of a node.js website). I am not trying to go the other way of using node.js to pull data from what I think is a google analytics API. I am not trying to clone the google analytics dashboard on a site.
This is my website.
https://rocky-temple-91974.herokuapp.com
In google analytics stream I have the Measurement ID copied and ready. Do I have to add code to my node.js website and paste in the Measurement ID? Is there a node package I need to install in my site code?
Remember I have google analytics 4 not Universal.
Finally, I see everyone knows how to do this with Wordpress and Shopify. Wordpress has a plug-in that allows you to paste in the Measurement ID. I am thus wondering why no one says or knows anything about using google analytics 4 with node.js. With node.js it seems no one is trying to view the site visits by logging into google analytics and using the google tool.
If google analytics account viewing does not work with node.js I would like to have a code snippet for node.js that would say save counts to a file in my node.js public folder. I am using mongoDB Atlas and another way would be to save visitor counts to mongoDB. Any hack like that would be appreciated.
I have not had any luck finding how to use google analytics for node.js (everyone knows how to use Wordpress to do it).
Thanks everyone! I feel this is a worthy question to ask.

Related

How to to get links report with Google Search Console API?

I am currently trying to develop a tool to use Google Search Console API in order to get some data from my website.
My main goal is to get the 'Links Report' such as Top linking domains & Top linked pages in an automated way.
I don't know if this is available via Google API. I have found nothing till now.
Is this even possible to get such list via the Google Search Console API?
I'm doing the same thing, hoping someone will answer that question

How can you connect python to the Microsoft store and download an app?

I was wondering if there are modules, or code snippets to create a program that connects to the Microsoft store, in the background, and download an app(without pyAutoGUI). Thanks in advance.
There are no Official API's for accessing Microsoft store, A Possible solution is to use requests library or other equivalent to create a bot that can access various fields available on the website and navigate through, if you always want a certain(Same) application to be downloaded may be you can go directly to that links page and use get request for the download button as submit, this should work in theory, but again this will also keep breaking in short durations as Microsoft keeps making changes to it's website.
P.S. You might want to fool the website by adding headers to your request.

Set up Google Analytics to track a command line Node app

I'd like to use Google Analytics to track usage of a command line Node app. Tracking will be strictly opt-in. I'd like to track basic usage, plus which operating system and version of Node was used.
I've found the Measurement Protocol, but I'm wondering whats the best way to set up Google Analytics.
You can choose from Web or App - App seems the best fit, but then I'm sent to Firebase to set up an iOS, Android or Web app. None of these are correct. So is 'Web' the best way to track my app usage? Or is Google Analytics not the right approach?
Seems like the best approach is Google Measurement Protocol. There's a Node library for it.
Really Google Analytics is completely designed around web apps and more recently mobile apps, it has concepts like "page views" which don't make sense for CLIs, and Firebase Analytics is only for Android and iOS.
You might be able to shoehorn he CLI use case for some purposes. Alternatively, you could consider using a cloud database like Firebase real-time DB to capture your own events.
Google analytics really isnt designed for something like this. You have only two options web app where everything is page based. http://example.com/hello.php vs using a mobile app where everything is screen based. Home, about, help.
I have done this before with several console applications, a custom SSIS task (dll) and an arduino project. I chose mobile application mainly because i thought it was closer. I know of someone who did the same with an actions on google project.
In the end what you use will be up to you. Just consider what it is you want to track exactly and lay it out before you start.
If you choose mobile make sure you send Screen views and not page views. The Google analytics website is split you cant mix and match the hit type.
Workaround for createing moble account without firebase.
create a new web property on Google analytics type Web
create a new view under that web property type mobile.
We made Console Cat for this exact purpose! It's built from the ground up to track telemetry / analytics for CLIs including things like flags, command duration, version, etc.

Amazon Cloud Search Experience

I might get flagged down by this question.. but still will give it a shot..
Since Google Site Search is going out of business and we are not interested in the free version of it - We decided to go with the Amazon Cloud Search option. The challenge though is - it is not straight forward. We have to build a crawler and there are some features that needs to be custom built.
I am trying to see examples where websites have used ACS and worked but i am not able to find anything good.. Have anyone tried using Amazon Cloud search for their Website search. Our website has around 15000 plus pages.
We are .net based solution - so i am thinking to write a crawler.. extract content on nightly basis and send it to Amazon. Would it be the right way?
ACS is based on Solr. If your site is under your control, i think the first step is extracting all useful content out and generate them into xml/json files, then use AWS CLI upload these documents to ACS. ACS has REST APIs to let you to get the query result. You need to define indexes before uploading them.

Google Custom Site Search Not Tracking in Universal Analytics

We upgraded to Universal Analytics about a year ago and since upgrading our Site Search isn't displaying the keywords within our Analytics account, or even tracking the number of times it is used.
This is a problem as a marketer as I like to know what people are looking for so that I can provide them relevant content.
All I can find on the Google blog is this:
https://support.google.com/customsearch/answer/2715510
'At this time, Google Custom Search Engine, is not compatible with Universal Analytics.'
Has anyone got any suggestions as to how I can get this data back? Are there any other custom site searches that I could use instead? Are Google even looking at this?
Google CSE is using old _gaq calls for analytics, it can be mimicked by adding following code line at the end of universal GA snippet:
_gaq={push:function(){ga('send','pageview',arguments[0][1]);}}
View - View settings - Site search settings is on and correctly tuned?

Resources