Custom event tracking doesn't send event - wordpress

I'm trying to get custom event tracking to work on my website.
My problem is: The custom GA tracking is not being send. I cannot see it in GA or in my network tab. Also there is no error in the developer console.
How can I debug / fix the problem?
What I have tried to solve the problem:
We use GTM to implement GA. GA works fine.
I have created a function to get triggered when a event occurs. I have tested the function - it fires properly when the event is being triggered.
The the ga 'send' command uses functions to dynamically generate the right tracking. I have tested the functions individually inside a console.log >> they work fine.
I have tested that the 'ga' command is available. It is not being rejected by the console with an error message like 'unknown'. So the command is available. It just doesn't work properly >> no error message at all.
Technical Background:
We use WordPress 5.0.2 to run our website.
I have tested it locally (WAMP) and on our staging environment.
The function:
function stepTracking() {
ga('send', 'event', eventLabel(), eventAction, eventCategory());
}
My goal is to A. Understand why the command is not working and B. Send the tracking properly.
Thank you guys,
Max

It looks like you are using a GA event as opposed to a GTM event. Try the dataLayer.push mechanism.

Related

fire gtag event from a local machine / different domain

im trying to fire a gtag event (analytics) from a local machine in windows.
is it possible ?
i tried to change my domain in the hosts file to be like my analytics domain ,
but it didnt work.
events from prod env worked fine.
the only differeces between the calls were:
1.the local website sent an http domain dl=http:// /login?returnUrl=/& ,
gtm - which is probably time and supposed to be different .
_gid - which sounds like id of call , which also sounds like should be different.
we fire a call using gtag mnethod:
gtag('test', 'test6666', { 'event_category': 'test', 'event_label': 'test6666' });
https://www.google-analytics.com/collect?
v=1&_v=j98&a=1506331396&t=pageview&_s=4&
dl=<domain>/login?returnUrl=/&
MessCode=4&ul=en-us&de=UTF-8&
dt=<dt>&sd=24-bit&sr=1680x1050&vp=1680x897&je=0&
_u=SACAAUABAAAAACAAI~&jid=&gjid=&cid=1729439813.1669892239&
tid=UA-960228-11&_gid=1536981198.1669892239&gtm=2oubu0&z=865507838
https://www.google-analytics.com/collect?
v=1&_v=j98&a=1995681705&t=event&_s=3
&dl=<domain>/login?returnUrl=/&
MessCode=4&ul=en-us&de=UTF-8&
dt=<dt>&sd=24-bit&sr=1680x1050&vp=1084x907&je=0&
ec=Login&ea=ClickAd&el=DbshopLookforBusinessb2c&
_u=SACAAUABAAAAAAAAI~&jid=&gjid=&cid=912047780.1669116634&
tid=UA-960228-11&_gid=1394515120.1669799137&gtm=2oubs0&z=612472842
It's most definitely possible to call gtag locally.
First, make sure your dev env deploys gtag.js.
Next. make sure that gtag is a funciton declared as a dataLayer push.
Finally, make sure dataLayer is defined.
Now to see your event, gtag('configure') has to run first for the lib to know where to send your event, so make sure configuration has been run. Also consider not using your prod measurement id for testing in lowers.
Finally, using gtag like that is not the best practice. It's a hack. Proper implementation should go through GTM. It will allow much better scalability, maintainability, ease of use and what not.

Google Analytics Page Tracking stopped working

my main problem is, that since the 23rd of July the Google Analytics Page Tracking is not working anymore, even though I did not change anything.
I have multiple Websites, which have an integrated questionnaire. If people answer a question, the URL does not change, but somehow (I did not write the questionnaire by myself, therefore I do not know how it is exactly working) Analytics tracked their behaviour as Page-View(with specific URLs e.g. www.url.com/question-5).
I think this is the line of code, which tells Google Analytics, that it shall track the Page-View.
window._mfq.push(["newPageView", "/".concat(M || t)]),
"function" == typeof window.ga && (window.ga("gtm1.set", "dimension1", e),
window.ga("gtm1.set", "page", "/".concat(M || t)),
window.ga("gtm1.send", "pageview")),
Google Analytics is integrated with Google Tag Manager and the Google Analytics Tag is triggered by the build in "Page-view" Trigger.
How is it possible, that it was working with no problems till last week and suddenly it is not anymore (on roughly 10 different Websites). It seems to me, that Google Analytics (or Tag Manager) did an update, but I cannot find any information regarding this.
Do you know, if something has changed in the last week?
Addition:
The Google Analytics Debugger tells me the following:
Executing Google Analytics commands.
>Running command: ga("gtm1.set", "dimension1", 200624)
Executing Google Analytics commands.
>Running command: ga("gtm1.set", "page", "/steps-route-1-1-question")
Executing Google Analytics commands.
>Running command: ga("gtm1.send", "pageview")
Ok, found the problem.
The variable gtm1 is not initialized. The page view is therefore no longer sent to GTM. I don't know exactly why that worked before. Possibly. had the gtm variable, which records the actual page view, the name gtm1 and due to some change on the part of Google this is no longer the case.
Yup this was a Google change. Events are now send using gtag function, see https://developers.google.com/analytics/devguides/collection/gtagjs/events

Why is Bing Custom Search API throwing an error when I make a call through node-js?

I was using Bing Custom Search API for the past week with no problems thanks to the free trial, but today, I tried upgrading to the S1 plan, since the API was sending error messages. I tried regenerating the key as well, but despite doing both of these things, I was still getting errors and unable to use the API.
However, I was able to make calls using: https://www.customsearch.ai/applications, where I was able to use my API key to test endpoints and get the results I expected. What baffles me is that my nodejs code which hasn't been modified aside from the subscription key should still work with the upgraded plan, but it doesn't.
I should be able to help here. Let us do little bit of troubleshooting once:
First go to https://www.customsearch.ai/applications -> click on your instance name ->Click on "Production" tab on top -> Try making API call on this page by providing Query and Subscription key you got. If this works, go to the next step.
On the page mentioned above you would have seen Custom Configuration ID and Subscription Key. Make sure those two are same in your node.js code. Ideally this should work.
If it still doesn't work, please share your error code so that I can get better understanding of the error you are getting.

Firebase create new audience not responding

Hello I am creating a new Audience in Firebase console for a game (already released on store with roughly 17k DAU). However, the tool keep becoming not responding. I checked it seems to be a problem with Firebase's JS. More details below:
Error in Chrome developer debug:
[Violation] Added non-passive event listener to a scroll-blocking 'touchmove' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
Screenshot: Firebase Javascript error
I tried changing the date range to 7 days, yesterday, today. Same error.
Is there a way to workaround this issue? Thank you

IcCube - How to retrieve full error messages for failed Google Analytics Api Calls

When you hit the "Refresh Datatable" Button for a misconfigured datatable inside the Google Analytics Plugin the command fails with the message:
Failed to load columns for table 'My Table' due to following error: 'Google Analytics Error'
This is not very descriptive.
So, how to get the fully qualified error-message which comes from the Google Analytics API?
Is there a way inside the icCube to log the error message which comes from the Google-API?
I tried to set all log-levels to DEBUG, but it did not help.
Alternatively, does Google log these errors, so that I can view them anywhere at the developer console?
It's an error on the current icCube version, will be fixed in 6.0 RC2.
Issue 254
When you refresh the Datatable, the API-Call analytics.data.ga.get is triggered.
So you can simulate this call inside the Google APIs Explorer.
Here you just need to put in the metrics and dimensions, like you did in the IcCube IDE.
How to get the profile Id is explained here.
After hitting the Execute-Button you can now see the full error-message.
A common error is to ask for more dimensions or metrics than allowed (max. 10 metric, 7 dimensions).
Of course it would be much more convenient, if the icCube Plugin would read the error-message and print it inside the IDE or the log...

Resources