How to record every moment in google analytics? - asp.net

i have implemented simple Google Analytic so for in my technical carrier, i.e. pages viewed by audience are recorded in Google Analytic. now one of my client is asking to record everything happens on the page, like click on specify buttons and video play, stop, time duration of video user watched. I have did some R&D on this and found
Event Tracking - Web Tracking (ga.js) from google.. but i am not sure how to use this.
and I also want to know, is this feature is only for paid users? or free users can also use this option. Please help me.

Event tracking in GA is awesome and totally free. You can track anything with it like buttons, clicks, youtube videos, pdf downloads, js form submissions ect ect.
Here is the basic layout for ga.js (the older version of GA):
_gaq.push(['_trackEvent', 'Category', 'Action', 'Opt Label', Opt Value, 'Opt non-interaction'])
Here is the breakdown and what each part means.
'_trackEvent' – This is a JavaScript method that starts out the array.
'Category' – the category that you want to show up, use something broad like external links, social links, images, videos, or form.
'Action' – This is the action that occurred; something the user did that you are tracking. For the ‘Action’ property use clicked, submissions, copy or whatever you are tracking from the user.
'Optional Label' – This is an optional field you don’t need anything, but when you start tracking a lot of stuff you want to be able to segment it out. For this property think of it like a specific category for example, facebook, box 2, or headline picture.
Optional Value – This is a number value for the thing you are tracking. There is no need to put quotes around the numerical value because its a number.
'Optional Interaction' – This one is a little tricky, it’s a Boolean value and it’s default is false, so if you don’t put anything it will be false. False means it won’t touch your bounce rate, but true means that it won’t count that visit as a bounce.
If you wanted to track clicks on a button you can do it in a couple ways. The easy way is to just add the javascript to the onclick= attribute in html.
<button id='button1' onclick=_gaq.push(['_trackEvent', 'Category', 'Action', 'Opt Label', Opt Value, 'Opt non-interaction'])> Button Text </button>
However, technically you don't want JS mixed in with HTML. It's fine for small stuff but it's better if you create event listeners.
You can do this really easily with jquery. Here is basic click tracking on the HTML button mentioned above.
$('#button1').click(function(){
//fires the event tracking method when button is clicked.
_gaq.push(['_trackEvent', 'Category', 'Action', 'Opt Label', Opt Value, 'Opt non-interaction'])
})
What in particular are you looking to track?
Note: the layout changed in analytics.js (Universal Analytics) you can read about that here.

Related

Google Analytics Phone Number Tracking in Wordpress?

I am trying to figure out how to add tracking with Google Analytics to multiple phone numbers on a Wordpress site. I saw this page from and earlier Stack Overflow post but I wasn't sure if it was up to date. I noticed somewhere else (here) on a Google search that said you have to add an Event in your GA account first and then add that code. Is this correct? Or do you just have to add the code itself to the Wordpress site without adding an Event in GA?
Also, if it's code for a link, can I highlight the phone number and put the code into the link area (as in chain link in the Visual Editor) on the page, or do I have to place this code in the Text Editor part of the page?
I'm using the current UA right now.
Also, I'm really new to this event tracking stuff, so please accept my apologies if I stated/asked anything incorrectly. Thanks in advance for any and all feedback.
Add a class to all your phone number instances within your HTML. ie class="tel">
Write a click function on that class, and then push the ga following the correct version syntax.
ga('send', 'event', 'category', 'action');
So:
$('.tel').click(function() {
ga('send', 'event', 'Category1', 'Action1', 'Demo!');
});
Use Google Tag Manager. It's great tool. There is also a plugin: DuracellTomi's Google Tag Manager for WordPress. You must read some documentation about GTM but when you will know GTM you can track almost anything on your site.

Contact Form 7 Conversion Goals Not Tracking

I am using Universal Analytics and have added the following code under the "Additional Settings" tab as suggested by dozens of articles including the one suggested by Contact Form 7's website:
on_sent_ok: "ga('send', 'event', 'Contact Form', 'submit', 'success');"
My Category, Action, and Labels all match set up in Goals. I have been testing this for hours and using various other methods on a different website but still no joy. I am not using any SEO or Yoast Plugins, and I have the Universal Tracking JS code installed.
Yet it's still not tracking. I can see it under Real Time Conversions, but it doesn't appear in Real Time Events nor Conversion Goals. What the heck could I be doing wrong?
After trying every code on the internets, I figured out how to simply set it up using Tag Manager! Obviously you have to have a GTM Account and paste the Tag Code on your website. Here's how to set it up:
Set up a New Trigger called "Form Trigger"
Choose "Custom Event"
Fire On, copy and paste this: gtm.formSubmit
Create Trigger
THEN ---
Set up a New Tag called "Form Submission"
Choose Product: Google Analytics
Choose a Tag Type: Universal Analytics
Enter Analytics Tracking ID
Track Type: Event
Category: Contact Form (or whatever, this will match the category name you set up in Goals in Analytics)
Action: Submit (or whatever, this will match the action you set up in Goals in Analytics)
You can add a Label and Value if you want, just make sure they match when setting up goals in Analytics. I just left them blank in both cases.
Fire On: click "More" and select the "Form Trigger" trigger you previously created.
Save Tag
Then just set up your Goals in your Analytics and test your form. In Reporting, I clicked on Real Time >> Events, filled out the form and BAM! I saw it right away and it recorded in Conversions instantly!
This was THEE only way I could get it to work. Works with sites with or without Yoast or whatever other SEO plugins. I hope someone finds this helpful, I tried EVERYTHING and this was the only way I could get it to work.
Cheers!

tracking clicks by device/ os in tag manager/ google analytics

I have a link in the header of my website which takes users to the 'my account' page.
On a full screen desktop browser the link is is a small icon and the text 'my account' next to it (using ':)' to represent the icon btw) i.e.
:) my account.
On a mobile or tablet (smaller screen), only the icon appears and not the words. i.e.
:)
To conserve screen space.
I want to see whether I have put the my 'account link' in a good place. And whether people notice only the icon, when on mobile or tablet.
I plan to measure this by seeing how many times the 'my account' link is clicked and split up the clicks by device/os.
For example i might find, lots of people click the 'my account' link on the desktop site, but hardly anyone clicks it in comparison on IOS or any other mobile device e.g. android.
Thus showing it perhaps isn't as noticeable or is confusing when i only display the icon without the text on small screens.
Does anyone know how i can achieve this in tag manager/ google analytics.
I previously set up tags that track page views and virtual page views(using datalayer variables) so have some experience with tag manager V2.
(as an aside is there a way to tell whether a click has come from a mobile or tablet also?)
Thanks for any input!
The easier way to do this is to set a simple GTM tag with firing rule - click on the element you want to track (by class or id or whatever you wish), send the clicks data as events in Google Analytics and review the event with secondary dimension device category (which is mobile/desktop/tablet), or even device name/model. You can create a custom report for this to be easier to access everytime.
So - 1st - set a new GTM Tag - type Universal Analytics, Event, and fill the "Event category" as "my-account clicks" (just an example).
Look at the source code of your site, and see if the link have an id to use (for example - id="my-account"). Set a firing rule on clicks - some clicks - element id equals my-account. That's all actually, the clicks will send an event to GA. You can get some more info to be sent with the event, like setting event action - "Clicked on: {{url}}", to give you information on what page the user clicked the link. You can play also with the firing rule, but that's the basic setup.
Once you are done you can test it with Real-Time, under events.
Later, when you collect enough info - just go to events in your GA, under behavior, click on the "my-account clicks" and set a secondary dimension - device category.

Google Analytics - Multipe Visits and Events

Can anyone please help me clarify below queries?
Including GA code two times in a same page cause double visitor counts?
Using below/event code directly on the page, does it creates an events directly in the GA portal? Or first do we have to create 'Video' as event first in the GA portal and then call this so that it will map itself?
Ex: _gaq.push(['_trackEvent', 'Videos', 'Play', 'Gone With the Wind']);
In google chrome extensions, while publishing it will asks for the GA id, and we provide, and if we keep main GA code in the extension pages(popup.html) too, then does it count as twice?
1. Including GA code two times in a same page cause double visitor counts?
If it's the same code pointing to the same account# and you aren't doing anything inbetween like deleting cookies, then no, it will not cause double visitor count. However, it will cause double page view count.
Using below/event code directly on the page, does it creates an events directly in the GA portal? Or first do we have to create 'Video' as event first in the GA portal and then call this so that it will map itself? Ex: _gaq.push(['_trackEvent', 'Videos', 'Play', 'Gone With the Wind']);
Traditional GA does not require you to do anything special in the interface for this. You should see "Video" show up as a value in the Category dimension automatically.
In google chrome extensions, while publishing it will asks for the GA id, and we provide, and if we keep main GA code in the extension pages(popup.html) too, then does it count as twice?
I think you may be confusing your Google Developer Account ID with the Account# associated with your google analytics account, but if your extension outputs GA code and there is also GA code on the page and it points to the same account, then yes, it will count some things twice (see your first question).
To be clear, every time a _trackPageview is invoked, a page view will be tracked. So if you have multiple calls to that then it will count multiple times. If the visitor cookie isn't reset or broken, it will count as the same visit(or).

Google Analytics Tracking Conversions with vendor data and custom campaigns

Please help me understand this. I have a client for whom we created a sweepstakes "mini site". Traffic was generated through banner ads, eBlasts, and newsletters. For the banner ads, I created custom urls, i.e. www.somewhere.com?utm_source=yahoo?utm_campaign=abc to track the traffic to the landing page per vendor/banner. this works just fine.
The entrant visits the page, signs up for the sweepstakes, has as double opt in email process for verification. All of my entering traffic to the landing page is tracking fine, and is properly broken down by utm_source and utm_campaign.
Some of the vendors had me place tracking pixels on the confirmation page for conversion statistics. The only info I have placed for internal tracking on the confirmation page is the GA tracking code.
I have been told to create tracking pixels to track the individual vendor conversions. Is this possible without the originating pixel data from the vendor? I am new to tracking pixels, but my understanding is that I need some information from the vendor in order to write the code for the pixel. Am I wrong?
I can't understand how we can place a tracking pixel on our end without at least campaign name or data from the vendor's tracking pixel that they placed on the page containing our banner ads.
What am I missing here? How can I actually separate the conversion traffic from the different sources when everyone receives the same double-opt-in email?
Please ask me to clarify if I am not being clear. Thanks in advance for reading my question.
There are two things you are trying to track here. One is Campaigns: Campaigns are how you measure the effectiveness of techniques to bring users to your site.
The other thing you are tracking is Events - this is what users are doing once they arrive at your site. If you want to track individual vendor conversions, you should add an onclick handler to either the submit button, or link that you are calling a "conversion"
For example:
Your link here
If you are adding the push to a form submit, you might want to have that push happen on the pageload of the success page, rather than the onClick of the submit (otherwise it will track the event, and it might not have actually happened due to form validation errors for example)

Resources