Identify existing clients by event - google-analytics

I'm interested in working out how many visitors are going to my site who aren't already clients.
Currently the only way to identify whether someone visiting the site is an existing client is if they log in, which takes them to another area which doesn't have google analytics enabled.
I'm tracking the event already when they login with the following code
_gaq.push(['_trackEvent', 'Membership', 'Login', $('#UserName').val()]);
Can I find out the number of visitors who browse the site without triggering this event?

I think I've worked it out.
In google analytics you can add a custom advanced segment, in the above case its 'Event Category' = 'Membership' and 'Event Action' = 'Login'.
From there you can tick 'All Visits' and the custom segment to get a comparison.

Related

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!

"Invalid tracking Id. Aborting hit." for Event Tracking

I have 2 ecommerce sites hosted on Shopify and Google Analytics properly implemented on both sites. I check my analytics daily, all that's good. Recently, I've been trying to do event tracking every time someone adds a product to their shopping cart.
Pretty much following this tutorial.
So I added the following to my add to cart buttons: onclick="_gaq.push(['_trackEvent', 'Products', 'Add To Cart', 'some-product-title']);" . This is working perfectly on my first ecommerce site, I see the event being tracked in Google Analytics.
On my second site however, it's not going through and I'm getting an error... using the GA Debugger, I tried doing that event tracking command in the console: _gaq.push(['_trackEvent', 'Products', 'Add To Cart', 'some-product-title'])
I get the following error: Invalid tracking Id. Aborting hit.
What does this mean? Trying to figure out how GA is being implemented differently on both sites, but can't figure it out. Thanks
Perhaps your new site is using Universal Analytics (analytics.js)? If that is the case, you'll have to update your event syntax to:
ga('send', 'event', 'Products', 'Add To Cart', 'some-product-title');

Google Analytics Custom Tracking

For marketing purposes, if a link to our company website is posted on a page on an external website. Is it possible to track the time in which the user landed on the external website and clicked on the link to our company website, using custom tracking ?
I have been reading about custom GA tags however am having a hard time understanding how to make the above possible.
Thanks in advance!
You cannot track an external website, as you can only track sites where you control the tracking code.
If you have control over the external site and have implemented analytics tracking there you would
create a timestamp on page load
add an onclick event handler to the link to your site
in the callback function for that link create another timestamp, substract the original timestamp to get a duration
send a user timing call:
ga('send', 'timing', 'Link', 'Duration to click', duration);
Where the "duration" parameter would be replaced with your timestamp.
As I've said that would only work if you can run your own Google Analytics on the external site which does not seems very likely. Plus I have really no idea what you mean by "custom GA tags" (there are custom variables and custom dimensions/metrics, both of which will not help you here).
So basically the anwser is you can't, really.

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).

How to record every moment in google analytics?

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.

Resources