Migrating Meta Pixels from website to GTM - google-tag-manager

Question about migrating manually inserted Meta pixels/Events to GTM. Any feedback is much appreciated!
We manually installed the FB Pixel and manually created events b installing the code into our website a few months ago.
Now, we want to migrate all of these events, including the pixel loading code to GTM.
My question: If I delete the existing pixels loading/event creation code on the website and create the appropriate tags/trigger in GTM:
a) will those 'new GTM' events be pushed as new events to Meta
b) will the pixel have to re-learn?
c) will I lose the data flowing into my existing ads?
For example, if I delete the following code from the website and create the appropriate tag in GTM how will these events change?
<script>
fbq('track', 'Lead');
 </script>

a) No, there is no magic whatsoever. Inspect how the network requests to Meta look right now, then reimplement them in GTM and in GTM preview on your lower env make sure the GTM-spawned network requests are exactly like they are on prod. As long as the requests are the same, the endpoint won't know the difference.
b) No, it won't know anything has changed. Exceeept... Note that some adblockers may block GTM, but allow facebook, so the volume of conversions may be slightly lower, but that shouldn't affect FB's learning.
c) You may lose some data, but not much since most of the adblockers block both, facebook and GTM. The data loss is likely to be low enough to be immeasurable and insignificant.
But again, during the development, test your network requests if you don't want surprises. The data should not change unless you make mistakes.

Related

Bridging the gap between _gaq.push and gtag

Looking more for some fresh ideas to help me troubleshoot the below problem than solving any coding issues (which may come next).
Creating a similar site to an existing one that uses all previous GA tech (analytics.js, _gaq.push, Google_Service_AnalyticsReporting_ReportRequest(), etc) and provides all the easy data needed for my simple GA reports (i.e. page views by date and location).
However, not quite ready to bite off the whole enchilada (GTAGMgr, GA4, and such) so created dual Properties (UA and GA) as many forums have recommended when making the transition.
Setup the website same as the active [UA] site but using the gtag.js (per the Property Tracking Code snippet provided in ADMIN) vs the analytics.js code. Created View(s), new Service Account for the "user", an API Map Key for the Google Map Charts, and any other pieces I could find.
Have the GTAG.JS setup on each page and added any special page tracking via gtag('event', 'page view', {...}) but letting the default page view still occur as well.
Page view hits are coming through as expected EXCEPT the page views locations (City, State, Country, Region) are not being populated. All that comes thru is the "not set" for any location. Ironically, the old analytics.js code was still active initially and location data was being populated.
Would think if gtag.js is collecting standard page view info for the configured Property, that location data would be there as well. Am sure it is but possibly the older getReport calls need tweaking. No doubt I probably have a something not quite right but if REALTIME data shows usage, page views, etc. AND my GA Report calls are working, would think location data would be there too.
Any brainstorming ideas would be appreciated.
Thank you,
LarryG
ANSWER ... the EZ Button ... my code and calls were correct using old and [semi] new way. The majority of the problems were McAfee VPN kicking in. It is set to turn on with reboot and I do not always remember to turn it off. The first obvious clue was the realtime location for my actions were not where they were supposed to be. Also, appears Google API PHP Client has some issues with PHP7.4FastCGI.
So if you took the time to read ... check your VPN settings if you are getting an abnormal amount of NOT SETS in your GA data.
Begs the question ... with the increase in companies providing VPN services out of the box, that renders some of the tracking a moot point.
LarryG

Difference in Sessions data in GTM vs GA

I found 10% high number of sessions in the GTM analyitcs data than the GA. Both has different tracking properties, have similar settings(as Simoahava mentioned #here), Hence the Ecommenrce rate is affecting due to huge difference of sesions data in both properties. Any insights ?
Screenshots :
Session via GTM Session via GA
Even when out of scope for the question i need to advice you to remove the legacy UA code from site and just duplicate the hits from GTM. (Simo has a post about it)
Now going into the question it self this can have a couple of reasons:
Does the filters on both views match?
Does both views has the same region (on the config)?
And i have another theory but this is not at all checked. (i would like to look into it)
GTM has a noscript snippet which allows to send non-script dependent tags even when javascript is not enabled. This is an advantage against the old GA code which doent have this feature.
Point i may have to look into:
Does the pageview count as a non-script dependent tag?
Is the traffic without javascript that relevant in volume? (10% is a lot)
Hope it helps !

I'm unable to run experiments accross subdomains using Universal Analytics

I'm currently running an experiment without redirect, using Google Analytics, but I'm running in some issues.
The case
I work for a company that has two websites, with two separate brands, selling the same product. Today, we are plaining a merge of the brands, one of the reasons being the low costs of maintanance.
To see how this would affect sales, we are doing an a/b test. The test consists of changing the logo of the sites, and displaying an information about the merge of brands in the variant. The original is the website without changes.
We have some requirements to do it:
We use a CMS that has no support to the Google Analytics Experiment tag (we get some errors when we install it to the , and are unable to run it)
We need to run it through all pages of our websites. We have also a subdomain in each site, that the user is redirected to place an order.
We doesn't have time to wait for the experiment to end for itself. So, we came up with the idea to track the rejection and sales using a duplicate pageview with "/variant" in the url and in the title.
To do that, I used the Content Experiments without redirects, with the Google Tag Manager.
Configuration of the Experiment
In Google Tag Manager, I load the Content Experiment Javascript API and define the choosenVariation variable in all pages of both websites and subdirectories.
I track the "gtm.load" event, to see when the page finished loading all elements and change the DOM in three ways: changing the logo, adding the content about the merge and add an item to the main menu. All of this, through Javascript.
Along with the changes of the DOM, I add a datalayer called VirtualPageView, and pass the corresponding url with "/variant" and the title with "Variant".
When the datalayer fires, I send a new Pageview with the variant information.
The problem
The experiment is running right, but when a user gets the B variant of the experiment and procceed to a subdomain of our websites to place an order, it seems that it's somehow running another test, and happens to the user get the A variation.
We are trying to persist the original session and the client Id through the domain and subdomain, in order to the user that saw the different logo, continue in his way to order.
I saw this page about Running Experiments across Subdomains, but its about the Classic Analytics and the classic experiment, and we are using the Universal Analytics with the Content Experiment without redirects.
I don't know if my explanation was clear enough, so if someone have doubts, please ask me. I don't have a profound knowledge of Google Analytics or the Content Experiments either. So, if you have a better way to do this, please, tell me.
I came up with a solution to our problem. We agreed to use the experiment only in the pages of the main domain, so I can change the content otherwise in the pages of the subdomain:
When a user visits our main domain, through Google Tag Manager, I created a cookie that says what the result of the variation chosen for the user (0 for the original and 1 for the variation).
When this user goes to our subdomain to place an order, still via GTM I check the cookie to see its value. If its equal to 1 (a variation), I change the logo and the menu, according to our previous configuration, and I send a virtual pageview to help us check the data.
Until now, this is working properly.

Twice GTM code installed, does GA count hits twice?

If a website has two GTM code installed, how does GA count traffic? Does it mean the traffic we see in GA report is duplicate?
They are different containers but same GA property.
Thank you!
If both containers have the same GA account and both populate on the page (e.g. have the same rules), then yes, you'll have double the pageviews.
Well, first of all, why do you have 2 GTM codes?
When you set up a container and install the GTM on every page, you must also set up GA tracking as one of your tags on the Tag Manager container settings, when you set this up, you will have to choose which pages you wish to track, most likely, you need to select "All pages". With the live preview you can verify your tag is working and you can go to the GA real time traffic dashboard to make sure data is being recorded appropriately, of course, depending on your traffic, it might not be easy to tell if you are double-counting.
I guess I would say if you set up your Universal Analytics tag properly, you shouldn't have duplicate data...
Back to my question, maybe I can help you better if I know why exactly you have 2 GTM codes?
:)

Google Tag Manager + Google Analytics v just using GA: any reason to use just GA?

I am using Google Tag Manager on all my sites now to implement Google Analytics and future proof them for any other scripts.
I am putting GTM in my boilerplate.
Is there any reason this might not be good practice?
Any reason why a website (that needs GA) should avoid Google Tag Manager?
Most websites will require some sort of Javascript code added in the future for affiliate tracking, various analytics and having GTM installed will allow for easy installation of any such JS code easily.
Or, as Google puts it: "Why wait months for site code updates? Google Tag Manager lets you launch new tags any time with a few clicks, so you never miss a measurement or marketing opportunity."
Since GTM does not come with a service level agreement you could (very very tenuously) argue that GTM adds an additional point of failure. And if one wanted to be pedantic one could point out that not all ways of analytics tracking work with GTM (if you track serverside via the measurement protocol).
But real life argument, there is none (IMO).
There might be pages that do not greatly profit from GTM (or any other Tag Management) if all you do is to deploy a single analytics tag to track pageviews. But the second you need to track an event or pass data GTM is already worth it.
This is not meant to be merely opinion based, it's more that in 2,5 years of using GTM on large sites I have been unable to find any scenario where the tag management code has caused any technical problem or interfered with existing code. On the other hand I do not write click handlers or submit handlers anymore, I have a boilerplate template for a container tag in which I just have to replace values for a few macros before I import it to GTM and have tracking up and running, I can set data fields with much less trouble than via the code... so I think there is a real technical argument to make in favour of GTM, and none against it.

Resources