Manually push data to Google Analytics Goals - google-analytics

I have create a goal in GA based on destination. But due to some changes that we did, we not using destination anymore and based on ajax result. So I wonder here if I still can track the goals by using it manually.
I found some docs here Google Annalytics Developer Guide, but did not found anything related to Goals.
Would be great if got experienced people in GA to advice on this

Send to analytics a fictitious pageview (virtual pageview) to activate the goal where you want.
In the measurement protocol you can use the dp parameter to define the page path (or dl the location URL) and match it to the one that activates the goal in Analytics.

Related

Can Client ID be Used to Retroactively Filter Internal Traffic?

With the goal of performing analysis that does not include staff traffic, I started following this guide to exclude internal visits which seemed great but apparently cannot work retroactively. In fact, I've heard differing opinions on if any sort of retroactive filtering of this sort can be done in GA at all. I'm very new to using GA, but one field I noticed is the Client ID, which seems to track browsers. If I could identify which Client ID's correspond to my coworker's browsers, could I use this to retroactively exclude them from analysis? This seems like it may work to me, but I have found no sources online suggesting this as an option.
If it matters, the analysis I am most interested in is tracking exit clicks.
ClientId is not a value normally available in Analytics reports, also if the coworker has deleted the cookies that value will be different.
This solution works for Univeral Analytics and not GA4.
With Google Tag Manager, you can create a configuration that allows you to filter out internal traffic.
In GA, you can create a custom dimension that tells GA which users are internal users and not. This information is passed on by Google Tag Manager via a query string.
For a step-by-step guide read: How to Filter Internal Traffic in Google Analytics with Google Tag Manager

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.

How does Google Analytics filters duplicate site entrances

We are implementing a native analytics system and want to apply the same tracking principles Google Analytics uses. We've figured everything out but one thing:
Every time I refresh a page with an url that has utm-parameters attached to it, Google Analytics somehow figures out that it's not actually a visit but the same page that gets refreshed and shows only one visit in its dashboard from that particular source.
Is anybody aware how GA specifically does that so I can replicate it in our system?
I know that I can use
performance.navigation.type
in my JS script, but it doesn't give me desired results.
Any help would be much appreciated.
Attribution in GA happens on the Google servers, so JavaScript will be of limited use. Basically since a reload means that the user has the same client id and no change in the channel (source, medium and campaign are the same as in the previous visit) the existing session will be continued (a change of campaign/source information would trigger a new Google Analytics session).
Google has a very nice chart that explains how campaign information and traffic source information is processed.

Can you implement google analytics with no domain binding?

We have a web service which is installed on different stations. Each has a different ip and domain. we want all of them to report to the same suite.
Can this be done?
The JavaScript tracker for Google Analytics can be used if you allow calls to the Google Servers, if you allow your clients to execute JS and either can set cookies or provide a client id in some other way (must not be personally identifiable data).
If you cannot use Javascript then you could still collect data via the measurement protocol, although this might require substantial development effort.
The domain setting in the Google Analytics interface does not affect data collection, it is used in the (soon to be removed) in-page analytics feature and as base url for the "open document" feature in the behavior reports.
Google Analytics does not collect by domain, but by property ID (UA-XXXXXXX-X), else cross-domain tracking would not be possible (it is actually a documented feature).
Cross domain tracking would be important if somebody could hop from one of your stations/domains to the other and you wanted this to be tracked as a single session. This does not seem to be your use case.
The only pitfall is that the reports display page paths, not full URIs. So if you have similar paths on all your stations the metrics for the page paths will be lumped together unless you do a breakdown by hostname. A common workaround is to add a filter to your data view that prepends the hostname to the path, or to provide custom paths in the first place.
But basically this is not a problem. If you do not need cross domain tracking you'll be okay if you dump the same tracking code in all your sites.

Should I link Adwords to all Analytics profiles?

I am setting up different Analytics profiles. The default one that shows everything, the master one that has the custom filters, and the test one where I test filters before moving them to master.
Should I link Adwords to all profiles or just the master profile? Are there advantages and disadvantages to both approaches?
I'm wondering if having it linked to all profiles will pollute or duplicate the data somehow.
The client is not actively using Adwords at the moment so I can't test this myself. But I'd like to set up the profiles correctly now so it will work when the client starts using Adwords again.
It shouldn't matter. You'd link GA to AdWords for two things: get a more indepth view of your paid traffic in Analytics and have some GA information (mainly conversion related info) in AdWords (if you link the two accounts in AdWords, that is). I'd say you're better off linking it always. There are plenty of segmentation/differation possible within GA regardless.
Edit: if anything, it'd make your data more valuable, instead of have multiple sets with several variants, besides just the filters.

Resources