GA4 - Configure GTM Server to work with stape.io and Site kit - google-tag-manager

I have some GA4 properties and to be compliant with the EU GDPR I need to configure a proxy server. I'm trying to use stape.io as proxy service but I'm not sure if I've configured it correctly. I've followed their official tutorial and I've added a new GTM Server. I've also created a web tag using Site Kit and connected it to the server url provided from stape, but no data seems arrive in GA4 Analytics.
Can anyone that already configured this way to use GA4 give me some halp on how to proceed correctly?
Thank you

Related

solve IOS 14 issue in google analytics

I'm set google analytics in tag manager to upload events from my website, but because the IOS 14 issue I can't upload events from IOS 14 devices, so how can I solve this problem, note: I have the events in my database?
To bypass iOS 14+ blocking, you need to use a GTM server container along with your web container.
Currently, all data that is sent from your site to third parties is blocked through iOS or Adblocks.
The solution is to download GTM scripts from your subdomain (not from googletagmanager.com) and send data not directly to google analytics, but to the GTM container server, from where it is already sent to analytics. That way the data will not be blocked.
Here is a more detailed description and links to step-by-step instructions on how to make the GTM container server setup: https://stape.io/how-to-prevent-your-google-analytics-data-from-being-blocked-by-adblockers/

Avoiding Google Tag Manager blocking by AdBlockers

I have used Amplitude analytics in the past in my react Web app to send event data. However I just started with Google Tag Manager and noticed it does not run because being blocked by adBlockers. Amplitude was always functional because I loaded their Javascript SDK through NPM install 'github:amplitude/Amplitude-Javascript' and initialized it at app load with client API key. I like the approach of Google Tag manager where I dont have redeploy app to make changes to my analytics logic. How can I take a similar approach to avoiding being blocked by adblockers.
It may very well be that Google products are popular so Adblock specifically just block google analytics products not other analytics products.
You don't. If people don't want to be tracked, that is their decision. You should not be forcing people to provide you with any data they do not want to provide. Especially by using some shady "bypassing" measures. Instead-
You could use a cookie to permanently disable your tracking of those who do not wish to be tracked, to help you preserve reliable analytics. See: http://www.multiminds.eu/2016/05/19/how-to-disable-tracking-via-google-tag-manager/
Or, better yet, simply measure the percentage of visitors who have disabled tracking so your analytical data can remain accurate. See: https://marthijnhoiting.com/detect-if-someone-is-blocking-google-analytics-or-google-tag-manager/
Yes, it's possible.
You can use reverse proxy for Google Tag Manager.
First, download the Google Analytics JavaScript library itself and host it on your server.
Then alter the code in the downloaded library to change the target host from www.google-analytics.com to your own domain name using find-replace.
Replace the link from the default Google Analytics script in your codebase to modified one.
Create a proxy endpoint to Google Analytics servers on your back end. One important step here is to additionally detect the client’s IP address and write it explicitly in requests to Google Analytics servers to preserve correct location detection.
Test the results. You’re done!
more detail info on freecodecamp.org/news/save-your-analytics-from-content-blockers and https://analytics-bypassing-adblockers.netlify.com
There's dataunlocker.com as well as some other open source alternatives (1, 2) which can help to fix reporting accuracy of Google Tag Manager, Amplitude, Google Analytics etc.
Talking about ethics and privacy, tools like DataUnlocker are just tools which allow you to bypass ad blockers as if you have implemented server-side analytics. I think by correctly implementing that "we use cookies" consent one can solve any privacy concerns.
I've managed to get around some blockers with the following in a node app:
var request = require('request');
app.get('/proxy*', function(req,res) {
const newurl = req.url.split('/proxy/')[1];
const data = request(newurl);
//data.on('response', function(response){console.log(JSON.stringify(response))});
data.pipe(res);
});
Then in your snippets for GTM prepend: "/proxy/" in the url and now the call goes via your server.
The caveat with the above is that without additional code you can't preview the container, but the container does load correctly. Lack of preview is a different issue to deal with.

Can we use google analytics for Internal website?

I have an Intranet application which is accessible from within company firewall. To track some specific pages, I want to implement Google Analytics in my Intranet application. This application is accessible from outside only when user system has some specific certificate installed.
Is it possible to implement Google Analytics in my Intranet application?
Will this Google analytics work inside company firewall?
How Google analytics work i.e. what is the actual flow of google analytics?
Yes, Google analytics can be used for internal web applications too. Please visit this URL which will clear your doubts. If you click on the given link and able to access analytics.js file from your internal network you can use Google analytics for your internal applications protected from corporate firewall.
Please note that after implementation, tracking data would be available around 24 hours only. So, you need to wait for 24 hours first. Even if you are not able to view the tracking data, please visit this link. You will find the possible reasons behind not working your analytics code.
In order for Analytics to generate reports for your corporate intranet
usage, your corporate network must be able to reach the Analytics
JavaScript file (analytics.js).
...
Your intranet must also be accessible
through a fully qualified domain name such as
http:// intranet.example.com. The Analytics JavaScript won't work if
your intranet can only be accessed using a domain name that isn't
fully qualified, such as http:// intranet
Ref: https://support.google.com/analytics/answer/1009688?hl=en
In your example, if a person without the certificate you mentioned can still reach the domain (that is, there is a public DNS entry for the domain name) even if they get an 'access denied' or similar message, the tracking should still work.
Google Analytics is Software as a Service and runs on the Google Servers. If your clients cannot reach the Google server than you cannot send tracking data and Google Analytics will not show anything. You may need to adjust your firewall rules to let calls to the Analytics servers pass (are you that you want a third party javascript to send data from your intranet to the internet, though ? There might be legal ramifications, too, after all implementing a script basically means to hand control of the clients to a third party).
If the server for your intranet is connected to the internet you could collect all hits in a log and pipe this to Google Analytics.
However Google Analytics might not be the best choice. You most certainly do not need campaign data, you probably do not have ecommerce in your company and depending on your type of company geo data and technology data might not be relevant (after all you probably know what computers your employees use and where they are). And for a page counter a self hosted solution will do just as well.
Google Analytics requires that you place a script on each page you wish to track. Whenever a page with the script is loaded, the script runs and sends data to GA, so your users must be connected to the internet as well as the intranet for their usage statistics to register. One security issue to consider is the titles of your intranet's pages will be sent externally across the intranet, which your IT security may have an issue with.
For basic intranet analytics, I'd recommend starting with Piwik which is open source and installs on your server.
It will give you a lot of initial usage data and if your customer decides they want more, you can look into more sophisticated products.

Google Analytics on Intranet without public visibility

I need to track an intranet site's traffic and would prefer to use Google Analytics because we have several other properties already being tracked there.
Google Analytics requires a public address to set up a new property for tracking. If I create a subdomain (intranet.domain.com) to satisfy that requirement, I believe the rest should work fine. (External .js file for Google is outbound-reachable from within our network, inbound-external access is blocked to protect confidential information.)
Does anyone have experience with this situation? Can you confirm the
proposed method will work?
Will the new tracking code work from any URL, regardless of the registered property address?
Thanks!
Google Analytics records data via parameters on tracking pixel requests. You need to make sure that requests for google-analytics.com/__utm.gif will go through from your intranet. (I'm guessing it shouldn't be an issue since you said google-analytics.com/ga.js is not blocked.)
It's also not a problem using the web property ID ('UA-xxxxx-x') on different domains than it was originally created for.

maps api v3 behind a proxy

i developed an application that is perfectly using maps api.
Today a customer ask me why his google maps is appear completely white on the website, and therefore I discovered that he uses a proxy on his network.
This proxy is set as "deny all" and my customer grants access host by host.
My question is, which host he must enable for allowing that maps api will work correctly?
My website uses API V3,
Thanks
From here:
http://groups.google.com/group/phonegap/browse_thread/thread/3d07771e7708763b
It seems your customer needs to whitelist:
*.googleapis.com
*.gstatic.com

Resources