using web page variable for google analytics - google-analytics

I am very much new to google analytics. I have a page level variable will have either zero or greater than 0. If it is zero then different db query will be executed and if it is greater than zero different db query will be executed on the same page which does not have any java script. Is it possible to get these actions in google analytics.
Please help me.

you need to place the Google Analytics (Java script) code in the head of the HTML document. once you do that, you can track these actions by using event tracking. Execute the Event Tracking Function in the database call position.
Event Tracking : https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide

Related

Google Analytics configured with GTM showing two pageviews. But when I check GTM assistant it only shows one

I have configured Google Analytics using GTM in my single-page application build in next.js. In order to check the pageviews I push a custom event to the data layer called "pageview" each time a user change to a new page.
In GTM I have created a trigger that looks for the "pageview" custom event and fires up the google-analytics tag.
Everything seems to be working properly but when I enter the debugview of google analytics and I change from one page to another 2 paweviews are recorded instead of one.
I have check GTM assistant and the tag is not firing twice, so I do not know where the problem might be.
This is messing my stats as I have twice more pageviews than in reality.
Here in the photos i upload you can see the tag. In the history and message no tags are getting fired
While this is what happens in google analytics (both page_views contain the exact same parameters (same page_refererr, page_location...):
Here is the implementation insine next.js. Basically I call the function GTMPageView() each time a route is change. GTMPageView() is the function that pushes "pageview" into the datalayer
I really appreciate any kind of help as I have been hours trying to solve the problem and I cant get to the end of it.

Getting analytics on custom events for Firebase Dynamic Links

Been reading through the Firebase Dynamic Links analytics documentation, and it's clear that the analytics presented in the console will only show three events: clicks, first opens, re-opens. However, I'm not able to tell if retrieving analytics from the API is limited to the same thing. The example shown in the docs only shows those three events too, but doesn't explicitly say that it's limited to them.
Is there any way to get analytics on custom events (for example, a purchase event) for Firebase Dynamic Links?
The three analytics events correspond with the actions you can perform on the dynamic link itself. If the link then leads to a purchase, you'd log that as a separate event from your app itself. The dynamic link won't contain that information, but the new event will of course be associated with the same app instance ID and user ID (if set).

Fill ExperimentID and ExperimentVariant without Google Optimize

We have a server side experiment running through our own implementation.
We started with Google Optimize to keep track of the experiment through their server side experiments-solution but some tracking seems to be off for us (not so standard setup). Now we want to test whether the problem is with our Optimize implementation.
What we would like to do is fill the experimentId and experimentVariant in the fieldsObject without using the implementation with Google Optimize.
We're using Tag manager for our GA implementation and while debugging we do see that the experimentId ("expId") and experimentVariant ("expVar") are being set but for some reason it's not being picked up by GA in our reports.
This is what I see in the GA Debugger for the other variant, this seems fine:
Is it possible to set expId and expVar in GA fieldsObject without using Google Optimize? If so, how and how do I see them in my reports?
If you are using GTM to also deploy the Universal Analytics tag - your tracker would not have the default tracker name.
Thus, the code ga('set', 'exp', '{expId}.{expVar}') (which implicitly assumed a default named tracker) would not set the fields on the tracker it should.
Instead, use the Optimize GTM tag, and fire it right before you fire the UA "Page View" tag - and set the ExpVar and ExpID explicitly as fields on the UA tag.
(get those values from JS vars, DL or cookies for example, after the server decided which variant and experiment the user should be bucketed to).
See these questions:
Google Tag Manager & Optimize Server-Side experiment sending variation
How can I set Analytics variables with Google Tag Manager from the server?

Google Analytics not generating data

I'm new to Google Analytics. Yesterday, I created an account and I pointed it to our website. I've added the JavaScript codes that Google Analytics generated for us. I put the code on all of our .html files.
I've been hitting our website from outside and so does my officemates since last night and also today. However, when I visited https://www.google.com/analytics under Reporting, everything was showing 0. I don't see any single spike at all.
I would recommend navigating to the Reporting -> Realtime -> Overview tab within your Google Analytics (GA) account. This is an almost realtime view into users on your site. In a separate tab access your site and refresh the page, this page view event should then be visible in the GA Realtime view.
If you can see your page view then its likely that you've inserted the correct GA script into your page and that you've used the correct GA property id. If you cant see your own page view then you will know that your script is incorrectly inserted or your GA property id is incorrect.
Last bit of advice: GA often has a 24-48 delay before you are able to use its full suite of insight tools (such as GA Goals). If you're expecting to see Goals populate immediately you're gonna have a bad time.
Last-last bit of advice: make sure that you select the current date from the date range picker in the top right of the GA Reporting view. It defaults to yesterday.

How to setup Google Analytic goals that go to different URLs?

I would like to setup my form's conversion rate as a goal in my Google Analytics account. The goal is complete when someone enters their information and hits submit. Logically, the "Thank you page" would be the destination URL for the goal. My problem is that the thank you page is outside of the primary domain, for example, my site is:
SiteExampl.com but the Thank you URL is thankyouurl.com
Is it possible to setup a goal like this? If so how.
Christina, this is a bit tricky situation as it involves cross-domain tracking and the visitor/goal tracking won't be consistent since each site is using its own sets of cookies. To keep this not that complicated and technical (for that purpose, there is a lengthy documentation by Google), I am going to assume that the conversion will be counted as simply the fact that the user pressed button.
You could then setup event tracking and create a new goal with a condition of this event being fired (Type = Event, in Goal details then use the same Category/Action/Label as you would you in the tracking code -- see below).
The example of event tracking code: (see the complete specification for details)
Submit
Hope this helps :)
this is possible . Please execute an Event when submitting the form. Then redirect to the thank you page.
Use form submission position or button click position and then execute the Event Tracking method and pass the related info at that time. Google Analytics give you an opportunity to setup events as Goals. Hence this will be a very easy task.
Event Tracking in Google Analytics:
https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide

Resources