Google Analytics setup (advanced Javascript) - javascript

I have three buttons on my website, all of the buttons opens a pop up contact form.
The three buttons are for different things e.g:
Request a call
Get a brochure
Visit us
But they all open the same form; What I want to do is use Google analytics to track the form and know what button they originally clicked; is this possible?
Can an onClick function be used on the button or something?
Really need some help on this!

Event tracking would be a better option since it won't over-inflate your pageviews. You can also set events as goals now.
Request a call
See the Event Tracking Guide

yes it's posible... '_trackPageview' it's your what are you looking for
check this links:
Official:
http://support.google.com/analytics/bin/answer.py?hl=en&answer=2558867
Others:
http://viget.com/advance/how-to-track-internal-links-in-google-analytics (recommended)
http://www.pointit.com/how-to-track-button-clicks-with-google-analytics/

Related

Redirect popup button onclick to a custom page

We have a popup form, which is triggered by Omnisend application on Shopify - we want to redirect customers to a custom thank you page, made by us (the page is made on Shopify also). But there is just simply no options for that in Omnisend.
Can i target or grab the class / id of the button with jquery and make a custom redirection based on that? As i cannot edit the source code, so i can't create onclick function.
Would something like this work?
$('#IDhere').click(function(){
Thank you so much if you try to help me! :)

Google Analytics: Tracking abandonment and goals for lightbox form

I have a series of forms which represent my site's Goals in Google Analytics. Each one redirects to the same page with a query string to differentiate between them (e.g. /thank-you/?form-name).
For reasons outside of my control, these forms have to be popups lightboxes and while tracking goal completion is as simple as adding a Goal URI for each "thank you" page, I don't know how to track abandonment. Abandonment in this case would be a user clicking "Cancel" instead of "Submit" in the popup.
Does anyone know how I can setup goal abandonment tracking using clicks on the Cancel button? I read about _gaq.push for sending custom Events to track, but I couldn't find how to link that to a Goal and track it as an abandonment.
Is this possible? If so, how would I set it up? Can it be linked to a specific goal so I can track the abandonment of each form separately?
As an aside, for the situation above would it be better to have separate goals for each form or one goal for all forms differentiated by the goal URI query string?
In cases where you cannot add the GA code to the form (lightbox, or 3rd party), I would suggest you to create a virtual page view that will simulate a page visit on that form.
Use the following in your JS code that calls the form:
_gaq.push(['_trackPageview', '/your-directory/form']);
If you use Universal Analytics, then:
ga('send', 'pageview', '/your-directory/form');
Now the form will be rendered as a pageview, which will appears on your reports and Goals' funnel visualization. Remember to set it as a step in the goal settings:

Track bookmarking event

Any idea on how can I track users bookmarking event? I want to find out how many users are saving a specific page into their bookmarks, and every time this happens I want to call a callback function (i.e. AJAX) to store this data.
For what I know of JS this is not possible: I can initiate a bookmark creation, but this is not what I'm trying to do...
Even a jQuery plugin is ok. Thanks!
It's not possible. Bookmark creation is outside a web page's control.
I wonder, How CodeProject articles are showing the Bookmark Count then?
(See the 'About Article' panel # right side for the Bookmark count)
for example see this one

omniture clickmap implementation on buttons, non-true link

Is it possible to implement omniture tracking on buttons or non links or that does nothing, maybe opening up a lightbox, google pin etc..?
I tried to put onclick=s_objectID=xxxx on these and it is however not tracking. Only tags with true links works.
Has anyone has a good suggestion or workaround?
Cheers
`a href="#" onclick="s_objectID=trackThisLink"`
`button onclick="s_objectID=trackThisLink"`
You will want to manually send a custom link image request in to have this data sent. There is a link tracking white paper within the SiteCatalyst interface you can use to get additional details on how to implement this.

How to get the number of time a user visit a page?

Does anyone have any idea about how to get the number of time a user visit a particular site? For instance, if you do a search on google and there's a link that you clicked already, google will tell you how many times you have visited that particular link. Any ideas on how to code something like that using javascript?
Thanks.
In Google's case they can track that you have clicked on a link. Its a specific action that they can attach a javascript listener to. If you want to do the same thing on your own site, you can add some javascript that does something similar, and anytime a link is clicked an AJAX call can be made that will allow you to track that it was clicked.
However, if you are just looking to get some basic stats about pages on your site you can add Google Analytics to it, and it will gather a large amount of useful data for you.
http://www.google.com/analytics/
If you want to know how many people are visiting your page, you probably want to check out something like Google Analytics rather than making it yourself. It will give you a lot of data that you'd have to make a lot of effort to gather yourself.

Categories

Resources