Google Analytics Tracking Code: Confirming Parallel-Run of Old ga.js & New gtag.js - google-analytics

All the while, I've been using the old classic ga.js (e.g. _gaq.push()) to generate monthly traffic report for my clients. Now, I decided to migrate over to the latest gtag.js in order to replace my custom variables with the new custom dimensions (or probably custom metrics as well). But one problem here:
How do I handle the Month Transition for the accuracy of report data?
When I think of parallel run of old and new tracking codes (at least 1 week before the coming month), I found this on Google Analytics Help:
You can, for example, install multiple instances of the Universal
Analytics tag (analytics.js) on your web pages but only one instance
of the Classic Analytics code (ga.js). Multiple instances of ga.js
might result in inaccurate data collection, processing, or reporting.
You can, however, install one or more instances of analytics.js on web
pages that also have a single instance of ga.js.
Therefore, I would like confirm this with some experts here: Is it SAFE to go ahead with one instance of ga.js and one instance of gtag.js on the same page? Note that if I don't implement old and new GA codes at the same time, let's say 1 week before the coming month, my custom variables will lose 1 week data; meanwhile, if I use the new report, my custom dimensions will lose 3 weeks data. Also, I just can't simply implement the new code on May 1, 2019 00:00 AM -- What if my new implementation doesn't work? I need several days to monitor it as well.
So this is important to me. I wonder if anyone of you here has experienced this and can assure me that this is safe to go ahead. Thank you so much!

IMPORTANT UPDATE, May 3, 2019: After using the below method for parallel-run for 1 week, the old tracking code doesn't seem to continue collecting traffic data even though I never change its configurations whatsoever. Apply it at your own risk.
Ok guys, after my full day experiment, it's confirmed that the classical ga.js (_gaq.push()) and gtag.js can be concurrently run on the same page and same site for the sake of resolving the migration issue as mentioned in my question above. The trick here is: Create a new property with new tracking ID for your new tracking code (gtag.js) with similar view settings and custom reports. Below are the steps:
For the new gtag.js:
Create a new GA property for the same website with new tracking code/ID.
Verify and complete your View Settings for the new property if necessary.
Define your Custom Dimensions accordingly.
Create your custom reports if necessary.
Get your new tracking code under your new Property -> Tracking Info -> Tracking Code.
Paste your new tracking code just right before your old tracking code (preferably in a different <script> tag).
Add your custom dimension code accordingly.
For the old ga.js:
Do nothing and keep it as it is.
After the cut-off date is over, just remove or comment out the old <script> tag of your old GA tracking code.
Open both your old and new GA reports with their respective property view and monitor the traffic result. If still no data on the new report, comment out the <script> tag of your new tracking code and troubleshoot again (or else it may affect even your old tracking code as well), make sure your custom dimension code has no errors, otherwise it should work with different tracking code managing different property ID (no conflict). If you need the same solution, hope this helps!

Related

Google Tag Manager click event tracking working but not displaying anywhere

I have successfully created a GTM trigger and tag using the click_text parameter. When I preview and when I published the change both were successful in showing up on my Google Analytics 4 debug and real time tabs. I cannot seem to find a recorded total for this new tag trigger in either GTM or GA4 anywhere. Does this exist in either of these, or do I need to create an event in GA4 unrelated to what I set up in GTM. I have read most of Google's provided documentation on this specific step and it stops flat at this step of things.
Thank you in advance.
If you see your event in real time data report in GA, you're good. The data is in that property. It, however, is not yet available for aggregation, so you won't be able to count them or use them in other reports.
You should wait up to two days for the data to be in the non-real time reports. Vast majority of the data will be available for aggregation in one day, however. Some starts showing up in hours. GA 360 (paid version of GA) shortens the two days to four hours until all data is there.
I'd also suggest using Adswerve plugin for GA debugging: it will print all DataLayer changes as well as everything that is being sent to GA in the console. It's much more comfortable than using real time hits report and it will show you all dimensions that are being sent to GA.

Metrics and dimensions are not showing up for hits of type 'event'

I have a fully functional and working code (written in C#) which purpose is to track some hits to the specified GA property. This code has been tested and still works successfully. It adds some predefined dimensions (like App Version) to each hit and a several custom metrics to a certain hit types (like event with a certain Event Action).
So far so good everything works flawlessly when taking into account the first property to which these hits are being sent. Also everything is fine when I set up a brand new GA property and track my hits to it - that is, I'm able to see events in Realtime reports, and events show up in custom reports after a while so that I can see my custom metrics.
The issue is that when I try to send absolutely the same hits to the existing property which had been created and configured ages ago - there is no both dimensions (even predefined) and custom metrics in my custom reports. I see these events in realtime and behavior reports, and I'm even able to create a custom report against events count - but that's it. I'm able to use for example Day of the month as a primary dimension, but when I try to use App Version as a dimension or my custom metrics as report metrics - it says "There is no data for this view.".
I've already tried everything I could, have read almost every post about custom definitions in Google and viewed almost each related SO question and answer - still with no luck.
We use measurement protocol
There is a correct User Agent being sent with each hit
17 days has passed since my first attempt to track these hits with existing property
There is no filters and segments at all
There is only one view
For me it looks like a property misconfiguration, but I've inspected each configuration page (I have all possible rights granted) and have not found anything related.
Will appreciate any help with this issue.
UPD: The hit itself (with the sensitive data replaced):
t=event&ec=session&ea=connection_end&el=b225d53a-6bb2-8021-f7b5-ae7004ae0a00&cm1=174960&cm2=1751494&cm3=479033&tid=UA-XXXXXXX-X&cid=4119e77f-be87-4530-04d3-33882f8eea77&v=1&av=XX.XX.99.555&an=my-awesome-app&aid=app.awesome.my
UPD: Here is what I'm trying to achieve (screenshot was made at the test property, where everything works like a charm):

Is it possible to selectively delete data (specifi page URLs) from Google Analytics?

I'm pretty sure the answer to this question is "no", but I would like to get a definitive answer from an official source, and also understand what my alternative options might be.
Long story short, my app has old data in it that used to include user email addresses as a GET parameter. Those URLs are showing up as unique page view URLs in Google analytics, like this:
I don't want to be recording email addresses in my Google Analytics account (for privacy reasons), and I have fixed the code that was causing this in the first place, but I also want to delete or scrub the old data that currently exists in Google Analytics.
From everything I've read, it doesn't sound like this is possible without completely deleting the property, maybe even the account?
To be clear, I am NOT interested in creating new views that don't include URLs with email parameters in them, or otherwise change the view and not the data. The data needs to be gone and be completely inaccessible to anyone with access to this Google Analytics account.
Here are the options I've come up with:
Delete the property and start over. I'm pretty sure this will
actually delete the collected data, but it's not clear to me if I
would have to actually delete the account itself to achieve that.
Set the data retention time to the lowest possible value (looks like 14 months right now) and wait 14 months for it to go away https://support.google.com/analytics/answer/7667196?hl=en
Perform some kind of magic to get in contact with an actual human at Google who could help me scrub or remove this data.
Does this sound right? Are there options I'm missing? If there's a way to do this through a Google API that would not be a problem.
If this is still a relevant issue. GoogleAnalytics provides a way to delete some data. Universal Analytics https://support.google.com/analytics/answer/9450800?hl=en and GA4 https://support.google.com/analytics/answer/9940393?hl=en&ref_topic=2919631
You are right: changing the data, that you have collected, and Google Analytics have already processed, is not possible. You have the option to make changes during processing with various filters, e.g. Search-and-replace filters, but as it is written in this official support article:
Like all filters, search-and-replace filters only apply to hits
collected after you've applied the filter to the view (filters cannot
change historical data).
Regarding you suggested options:
Deleting a view or property will result in a permanent loss of data after a 35 days period of waiting time. (While this could be undone.) So unless the requirement of scrubbing the collected PII is more important than having your historical data, this should not be a way to go. The same applies to deleting the whole account, so it would be enough to delete affected properties or views.
From the article you have linked as well, you can see, that data retention is about removing user and event level data, and it will not affect the data in aggregated reports. My understanding is, that an already created, page level report will keep showing the page with an email address:
Keep in mind that standard aggregated Google Analytics reporting is
not affected.
I hope these references help you to evaluate your options. Sorry for not being able to come up with a solution, but the basic concept is, as highlighted in this Google article:
Once Analytics processes the data, it’s stored in a database where it can’t be changed

Google Analytics Ecommerce / Difference between 'ec:addItem', 'ec:addTransaction' and 'ec:send'

I would look for some feedback on tracking user activity on an commerce website using th google analytics commerce capabilities.
I can't fully understand those 3 parts :
Adding an item (ecommerce:addItem) : obviously when some user add a thing to the cart
Adding a Transaction (ecommerce:addTransaction) : that's where I'm very confused
Sending the data (ecommerce:send) : that's obvious
Can those 3 event append at a different moment ? in what manner ?
What would be a real-world use case that would make you use execute ecommerce:addTransaction and ecommerce:send at a different moment ?
This thing makes me wonder a lot, and I'd like to have some experienced feedback on this as you tend to easily break your stats if something is not done week enough
Thanks in advance
EDIT
So the main purpose right here is to get stats for the pending orders (you add stuff to your cart), and the complete orders (you paid for the things you added).
Right now I only send it all when the order is complete, and things are working pretty good in analytics, but I just don't know anything about the ones that did not complete.
This question was a lack of knowledge.
Simple ecommerce plugin has nothing to do with the enhanced ecommerce plugin
You won't track that much with the first one, except the checkouts. A plain, one order at a time, revenue value.
If you want a deep insight on your users behaviors (when i say deep, I mean it), You have to go for the second one.
We might be able to debate over the unusefullness of the first one; and the fact that its existence in itself compared to the second is completely misleading, as when you first get in, as usual with google, you get flooded by an endless documentation
ecommerce:addItem does not add items to a cart; it adds items to a transaction (with "conventional" ecommcerce tracking there is no cart tracking, you'd have to use enhanced ecommerce tracking. Actually your title refers to enhanced ("ec:") and your question to conventional ecommerce ("ecommerce:") tracking).
So ecommerce:addTransaction starts a transaction; here goes the stuff that affects the transaction as a whole, like transaction id, tax on the total purchase or shipping costs.
Now that you have started the transaction you can add items to it that are associated via the transaction id.
Finally the ecommerce:send command tells Universal Analytics that the transaction should be processed on the server. "send" is actuall a misnomer; addItem and addTransaction do already send data to the server (they each create an request to the tracking server and thus count towards your hit quota).
The reason for this is, as far as I can tell, that the information is transmitted via url parameters (you call the Google Analytics endpoint which returns an transparent pixel). The maximum length for an url request is limited (actual limits depend on browser and browser version).
So the transaction is broken up into multiple parts not because you want to execute the commands at different moments but so it can be transmitted via Url parameters without being truncated. The send command merely tells that you are now finished adding new parts to the transaction and the data can now be processed.

Google Analytics reports wrong goal completions and events count

I have this GA-tracked application that is not counting all my events and goal conversions. Events are correctly displayed in the Real-Time chart, but the reports apparently discard some of them. My goal completion counts are being incorrectly reported, too - for example, in a given day my user registration goal displayed less than 20 goal completions but I had almost 100 new users.
I am using Universal Analytics and my pageview count is still low compared to the GA threshold.
Any thoughts?
I also found few bugs and especially some events not firing properly. Hence, I move to old code again. Even in old code,” doubleclick.js” code not working for some Event Tracking. After I replace the code with old” ga.js” file all the event functions start to work without any modifications to the source code. Please stick with the old code for next few months.
Just check Avinash website (http://www.kaushik.net) , as we all know he is the digital marketing evangelist for Google. He is still using the old ga.js code. This tells that this new Universal Analytics code have some hidden bugs and they are testing the code with user experience. Hence this is not the time to fully depend on Universal Analytics. Sooner they will come up with updates and then it will be ok to move to Universal Analytics.

Resources