Custom event landing page error - google-analytics

we are using GTM + UA for tracking. In some cases such as a new register, new publish etc. we are firing custom events using the dataLayer
dataLayer.push({
'event': 'gaTriggerEvent',
'gaEventCategory': "goals",
'gaEventAction': "register",
'gaEventLabel': "facebook"
});
Everything is setup correctly and we can see all the events being tracked by GA.
The problem we have is that the landing page in GA for the event we fire when user registers using Facebook Omniauth is reporting wrong Landing page.
For example, user enters URL "/", goes to "/xxxx", hits Register with Facebook, facebook calls for our callback URL which redirects the user to "/user/welcome" page. When we see second dimension Landing Page for this event it reports the "/user/welcome" and not the "/" - the entrance
We checked the event details with GA debugger and the clientId stays the same in all pages so there is no explanation why GA loses track of where the user who fired the event entered the site.
Also, is there any way to debug GA in real time like in Mixpanel? It's quite frustrating not knowing what the reported landing page for a event is until the next day :\
Thanks

Related

Google Optimize is implemented using GTM but is being triggered multiples times

We have an issue. GO is being fired every time I go to a new page. The website was built in SPA/react
Datalayer
They use a datalayer virtualpath that activates every time user go to a new page.
GTM
This DL was used as a custom event trigger to fire the Google analytics universal tag
Google optimize is associated to the Google analytics tag so every time a user to to a new page then go to a new page, the updatevirtualpath trigger is activated and the GO tag is fired.
Have anyone implemented Google optimize in GTM for react/ single page application websites where they use custom event as trigger ? When I use all pages trigger it works fine but when i use custom events it gets triggers every time user visit new pages..
Anyone know what can we do?

GA hits a new session by clicking on a button tracked with a GA Event

I created different Google Analytics tags (one pageview on all pages) and track event on some buttons with Google Tag Manager. When I'm analyzing the Google Analytics details by recording a session with Tag Assistant, I noticed the a new session is surprisingly starting when I'm clicking on a button on a page different than the landing page.
Ex.: Click on a Google Ads
Session 1:
Hit type = pageview (landing page) (trigger based on dataLayer event - the website is asynchronously loaded - single page website)
AdWords Click ID: xxx /Source, Medium, Name: (not set)
Click on a link: hit type = event
AdWords Click ID: xxx /Source, Medium, Name: (not set)
Hit type = pageview (other page)
AdWords Click ID: xxx /Source, Medium, Name: (not set)
Session 2:
Click on a second link: hit type = event
a new session is starting with the following information:
Source : Google.com, Medium : referral (instead of AdWords Click ID: xxx /Source, Medium, Name: (not set))
All the tags have the same setup, and surprisingly, if I'm landing on the second page from a Google ads, Google Analytics is not creating a new session. This issue is always occurring when I'm clicking on a tracked button on other page different than the landing page. If I'm coming from natural search or another campaign tracked with utm, Google Analytics doesn't create a new session. It's look like the Gclid data is not well passed through the website and more especially on track event button on other pages different than the landing page.
Has anybody already encountered this issue?
Thank you for your help.
Probably your site is a single-page-site or the URL is updated dynamically without refresh the page. During navigation you lose the gclid parameter but the referral remains the same (google.com), so the first session is google /cpc and the second generated becomes google / organic.
Try this tutorial to fix the problem:
https://www.simoahava.com/gtm-tips/fix-rogue-referral-problem-single-page-sites/

How to track site search(with query and without) via GTM? 2 ways of searching

I have a search bar on my website and there is 2 ways of getting search results
When they type keyword in the search bar and they press enter button. They will be redirected to the page with the url address with query. For example: /?s=test - I have this in GA but...
In the same time when user is typing keyword he gets search results in real-time via AJAX under search bar in the form of a list . When
the displayed result is clicked user will be redirected straight to the result page
https://imgur.com/L7aqOfM
And I want to know how to track this second option because Google Analytics is not able to collect this type of searching via AJAX.
Google Tag Manager and VirtualPageView? How to do it guys cuz Im a newbie
In your AJAX's success callback, you can fire a virtual pageview or an event with Google Analytics. Since you have used Google tag manager, you can push a dataLayer event
success: function(data) {
dataLayer.push({
'event': 'searchEvent',
'keyword': 'keyword'
})
.........
Then you can use this in GTM to create a trigger and fire an event or a virtual pageview. If you are using Virtual pageview, override your location parameter with something like /?s={{keyword}}, where {{keyword}} is a dataLayer variable and it would work

Google tag manager events not appearing in google analytics

A client has requested that we implement google tag manager on to track submission of all the forms on his website. We have set up all of the tags and triggers per the instructions that we found online but it appears that only 1 tag is actually working. We the Solids Conveying Case Studies event appear in the behavior > events> overview screen of analytics but not in the Real Time screen. All other tags do not appear to fire at all. We did view the preview/debug mode and see what appears to be a glimpse of a tag after the form submits and the page reloads. Also during our debugging process we tried setting the action to trigger on the form id, and we tried checking Wait for Tags. Any assistance would be greatly appreciated.
Here is a link to the website: https://foxvalve.com
Here is an example of a tag that we set up.
Tag Type: Universal Analytics
Track Type: Event
Category: Air Gas Ejectors (Different Depending on the Form)
Action: Submit
Label: Form
Value: empty
Non-Interaction Hit: True
Google Analytics Settings: Google Analytics Variable
Trigger Configuration
Trigger Type: Form Submission
Trigger Fires On Page URL equals (the page URL of the form)

Google Analytics Event firing too often

I have a page setup with the following GA JavaScript on the page to track pageviews
ga('create', 'UA-xxxx-xxx', 'auto');
ga('send', 'pageview', location.pathname);
I also have the following JavaScript within document.ready to track an Event
$(document).on('click', 'button[type="submit"]', function () {
if (typeof (ga) !== 'undefined') {
ga('send', 'event', 'Your Details', 'Save Address Change');
}
});
Within all development and test environments, the code fires only when it should (the form contains only ONE button) but in LIVE, the Event is almost in line with the pageview number (and the backend data confirms that the button has not been pressed as it is logged in the SQL database as it fires an INSERT statement). When I attempt to debug the JS, the event does NOT fire
Is there any way the pageview event on my form could then be triggering the event? Caching?
Using the secondary dimensions, I cannot find any data that tells me what or who is triggering this event on almost every pageview. All it confirms is that this is not isolated to one browser
The code looks like it would operate the way you would hope, so there must be something else going on... This isn't particularly an answer as much as it is other things to check that may lead to an answer:
How many Unique Events vs. Total Events are occurring for "Your Details"?
Are there any other submit buttons elsewhere on the page (search, subscribe, etc)?
Any chance you're loading your tracking script (where the event listener is) more than once?
How about spam bots? Have you noticed many server-side crawlers? This wouldn't be caused by "ghost" spambots, so check for Full Referrer as a secondary dimension.
Does this appear on both your unfiltered and filtered views?
Are any other core metrics (users, sessions, pageviews, bounce rate) in your reports odd?
Create a segment for just users who have triggered this event and look through all of your other reports. Are they following a typical funnel/path that you would expect?
Check the User Explorer to see if you can find a specific user who triggered the event. What else did they do? Does it look like a normal users?
You could add a custom dimension of Client ID and parse the GA cookie to track which CIDs are triggering the event (it would help you find them in the User Explorer).
Other custom dimensions that could help you get more context clues: Timestamp, Hit ID (random ID assigned to every individual hit), PHP Referrer.
The long shot: any chance some other script is triggering a click on that button?
I hope something here helps you.

Resources