Google Analytics sees 3 url's when visiting 1 page - wordpress

When my form is filled in on the page: https://www.example.com/gratis-inspiratieboek/ it sends to the thanks page: https://www.example.com/gratis-inspiratieboek/balkonbeglazing-bedankt/
But in Google Analytics it shows 3 pages loading at the same time:
https://www.example.com/gratis-inspiratieboek/balkonbeglazing-bedankt/ and https://www.example.com/1/gratis-inspiratieboek/bedankt/ and https://www.example.com/gratis-inspiratieboek/bedankt/
But the url in the browser is only: https://www.example.com/gratis-inspiratieboek/balkonbeglazing-bedankt/ and there are no redirects on that page or one of the other pages.
Do you have any idea why Google Analytics sees 3 url's when filling in the form?
Thanks for your time!

After setup the proper Google Tag Manager, you need to follow below process to make sure that you did the proper configration of Google Analytics through the Tag Manager:
Go on the workspace, click new tag, enter the name of tag, click on Universal Analytics here you need to enter Tracking ID and Tracking Type as a pageview.
Now, click on the big icon where it says choose a trigger to make this tag fire and select all pages.
Completed.
You’ve successfully implemented Google Analytics with Google Tag Manager. Your Google Analytics tag will execute on every page.

Your Google Tag Manager tags and triggers are configured improperly. There are too many triggers tied to different GA Pageview tags that fire on the same condition. This is why you have 3 pages recorded.

Related

how can I validate if good analytics is counting review with ajax request

I have installed the google analytics in our e-commerce site using google tag manager. From the product detail page you can click on the colors to see the same product in the different colors. I implemented this using ajax so the page load is not required. I was curious if the google analytics will count as multiple reviews a user clicks on the different colors or do I need to explicitly call something in order for the GA to count as multiple reviews.
First of all, that depends how and what kind of GA you've implemented.
To implement analytics, you have to specify a trigger for the analytics tag. That trigger normally determines if a tag is fired or not.
If you used a page load trigger, then the tag will only be triggered on the real page load. And it won't be triggered on your ajax manipulations.
With only one exception: if you used the GA4 config tag, you had this checkbox there:
The checkbox doesn't only send the pageview on config load, it keeps sending pageviews on every history change. Therefore, if your ajax causes history change and you use the GA4 config tag, then you're getting pageviews.
But this is theory. You can just go and check. Open your network tab, filter the request by collect and see what's sent when. Or alternatively, install the adswerve datalayer debugger and it will log whatever is sent whenever it's sent into the console in a very neat, clean way. This is how it works on this page:

Problem with traffic source and virtual events. Google Tag manager Analytics

I'm having some troubles with GTM and iframe.
My website has a button that redirects to Shore for booking. On mobile a new tag opens.
I can see at Content on Google Analytics:
/
/bookings/my-website/services?layout=nolayout&locale=es&origin=nolayout&theme_color=1f1f1f
/virtual/select-service
/virtual/booking-success
The problem is that I loose the medium. At the begining is Organic/cpc...
But on step 2 it creates a new sesion (none)/(direct). It's false.
Could you help me keep the medium on the /virtual/{{Event}}?
My GTM configuration is:
Trigger:
Custom Event
Event name: .*
Some custom events: Event -> matches RegEx -> (select)|(success)|(booking)
Tag config:
Track Type: Page View
Enable overriding settings on this tag (checked)
Fields to Set:
Field name: Page -> value: virtual/{{Event}}.
Tag firing options:Once per page
It's strange because medium is ok when the reservation is through Facebook or Instagram. It just fails on the website.
Thank you!
This is very likely an issue with the changing of domains as users navigate to the widget. Unless cross-domain tracking is specifically set up, when a user visits Site A and then Site B, and both sites have the same Google Analytics (or GA through GTM) tag, the visit to Site B will record a source/medium of either direct/none or {Site A}/Referral, depending on your referral exclusion setup. This is regardless of the source/medium was recorded for the visit to Site A.
In your scenario, hit 1 (/) is your own domain, and then (I'm guessing) hits 2-4 are on Shore's domain (probably connect.shore.com according to the help page).
To remedy this, you need to setup cross-domain tracking. The official guide for GA through GTM is here, but another excellent resource is Simo Ahava's blog. Note that cross-domain linking needs to be setup with every page in the funnel. This means if you are using GTM to deploy GA for the booking virtual pageviews, but are using the direct embed code to put GA on your own site (step 1), with analytics.js, then you need to follow the guide to enable it there.

Google Tag Manager referral hostname

I have 2 hotel websites on their own domains with individual GA tracking codes which both use the same booking engine, also on a standalone domain. The booking engine can only use 1 GTM container, so both hotel websites also have to use the same GTM container with the aim to track the ecommerce.
I've used a page view tag with a hostname lookup variable which pushes the correct GA tracking code on each website which works fine. Problem is tracking the ecommerce.
I've tried using a URL fragment so if they are on www.bookingengine.com/hotel1 then it would assign the correct GA tracking code, but that doesn't work.
What I need is the tag manager to know the referral hostname if you are on the booking engine and change the GA tracking code used dynamically, so it matches the correct referral website. Is this possible?
You can get the Referrel-Hostname by using the Browser-API document.referrer. This gives you the Page the User came from.
Take this as an Javascript Variable and build a Trigger based on the Variable:
{{referrer}} regexp abc.com

Hotjar & Google Tag Manager (GTM) with virtual page views

I have set up our Google Tag Manager (GTM) account so it sends virtual page views to Google Analytics (GA). This boiles down to pushing a custom event on the dataLayer (= GTM) array which will then trigger sending a pageview to GA. This works fine.
The same GTM account also has Hotjar connected to it, and I'm searching to send the virtual page view also to Hotjar. However, I can't seem to find any documentation about this. Hotjar does support it, but they only talk about doing it via their own "hj" function, and I'd rather do it via GTM.
Based on their official documentation they saying that Hotjar will track page views automatically if you changing URLs in your single page application.
If you SPA changing only fragments, then you need to use this setting "Track changes automatically, including fragments"
If you want to send analogue of "virtual page view" to Hotjar, then you should execute in your GTM:
hj('stateChange', 'some/relative/path');
You should be able to use hj and function should be already defined when GTM is triggering tag.
If you want detailed answer specific to your website, it will be better to share the link to website and the way how you currently configured GTM to track virtual page views

Google Tag Manager + Analytics doesn't seem to be working

I recently set up Tag Manager and Google Analytics.
In Google Analytics
I set up an account
In Tag Manager
I pasted the Tag Manager script just under the body tag of all my pages
I set up a container
I added the "Universal Analytics" tag
I copied my Google Analytics tracking ID "UA-...." to the tag
I added the "All pages" rule to the tag
I published the tag
When I hit one of my web pages, I see
- a call to googletagmanager.com/gtm.js?id=GTM-... (with my tag ID)
- a call to google-analytics.com/analytics.js
- a call to google-analytics.com/collect?...tid=UI-...&tgm=GTM-... (with both my tag and analytics ID)
Now when I go to the Google Analytics dashboard, I see no sessions, not even in the Real-Time session dashboard.
Under Admin > Property > Tracking Info > Tracking Code, it says "Status: Tracking Not Installed" I assume this is ok since I didn't copy the Analytics script to my page, but the Tag Manager script instead.
Is there some delay, or am I setting it up wrong?
I recommend every time you sent up GTM with a analytics tracking tag that you check that it sends data. This can be done by looking at the developer tools with chrome or firefox. Really any web browser.
In your web browser open up developer tools and open network. Find the filter button a and search for "UA-".
If you see something that says pageview, scroll down the headers and you will see your UA Account number and if you used GTM to implement the tag you should see your GTM tag ID.
Reload the page and check again. If you see it means it is sending data to the correct property. If it is not then there is something wrong with your implementation.
If you set everything up correctly and still dont see data check your filters. I always recommend keeping one view unfiltered.

Resources