I have a question regarding best practice for a Google Analytics implementation.
I have a website that has static pages, on which there are several opportunities for javascript interaction. I'm interested in what the best practice is for tracking these interactions.
For Example: There is a button that prompts a modal where users can join a mailing list. On this modal, there is another button for users to submit their email address. I want to know how many people click the prompt button, and how many people continue to submit their email address.
To my knowledge there are two approaches on this--
Events - Trigger an event when the modal is prompted, and a second event when the information is entered and submitted.
Pageloads - Programatically trigger a pageload for each modal dialog.
If I use events, I can track the activity, but don't have access to good funneling tools when I set up conversions. There is the 'Event Funneling Report', but it doesn't give me to give the other correlation tools available with conversions.
I do have access to conversion funneling if I trigger pageloads, but the interactions are not pageloads, and I don't want to skew my other traffic metrics.
What is the best thing to do in this scenario? Thanks!
I too wish GA would expand on event tracking to allow the funnels to be more like the page view funnels. I have yet to see any real argument about why they can't.. But there's no real best practice for this other than going with the limitation you are more willing to deal with.
A couple of suggestions though:
If you go the page load route, prefix it w/ something unique e.g. "~events/..." something that wouldn't normally be a page on your site, so that you can more easily filter them out of your normal pages report. Alternatively, setup a view with a filter that excludes your virtual page name (e.g. "~events/..") so you can see your traffic without it and not have to worry about filtering it out in the reports. Alternatively, create a segment that does the same. None of this offers a perfect solution but it does somewhat help making it less crappy :/
If you go the event route, also pop a custom variable. help as far as creating a funnel but does open up looking at it through those reports.
Related
I am building a project and I want to implement this:
a user clicks on a button
a pop up window appears showing star rating
the user enters his rating in the pop up
then I get the inputted value
anyone knows how can I implement this?thank you
Ok.
Question is too broad, but here are a few elements:
- you dont want a popup, because it's ugly, and browser often block them.
If you control the code of the rating form (same domain, same security level, and same code base) I guess a modal is the way to go (templating systems like knockout or angular will help you a lot). Then you can get the result with simple javascript (synchronously).
If you don't, a iframe is probably a good solution, and you can communicate with it via postmessage API, or websockets, or any other solution you can find by searching for this specific question.
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:
I am building a web application that will have a fair bit of forms. The html forms are generated using php.
One of the things I came across is this:
I have a drop down box for the user to select his country. Once he selects the country, a call is made to the server to fetch a list of states within that country and populate it in a drop down box.
Initially, I thought I could provide 2 options:
An enhanced jquery version where ajax is used to fetch the states and the populate it in a drop down.
Where javascript is not availiable, the whole page is submitted to the server and then rerendered with the new states in the drop down.
However, onChange() requires javascript. So if someone where to visit the form without javascript enabled, there's no way we can deal with the second option, since javascript is required to submit a form using onChange().
What are some ways to deal with this? My only solution at the moment is to just make javascript mandatory. Users without javascript enabled will see a message saying that the page will not work properly.
Some sites:
Hotmail.com - Refuses to show anything except a "javascript is required message"
Facebook.com - Tells us we should use the mobile version of the site.
Google Maps - Does not work. No message to say javascript is required.
Gmail - Falls back to basic html.
Google account - Does not work. No message to say javascript is required.
Is it acceptable to require users to have javascript enabled at the current state of the web (august 2011)?
Just came across this possible solution:
http://cita.disability.uiuc.edu/html-best-practices/auto/onchange.php
I could perhaps add a button which the user can use to select their country. This should allow us to reload and render the form with the states drop down without any javascript.
You can provide a drop-down of states and tell the user to leave it blank if not applicable. If JavaScript is enabled, it can remove the drop-down until a country where it is applicable is selected.
No, it is not acceptable to require JavaScript; many security-conscious users use NoScript, for example, and would prefer not to turn it off.
By default you should load all possible values into the second dropdown, then clear them out on page load with Javascript. That way people without Javascript enabled can still choose the correct option.
I'm guaranteed to take flak for this, but whether you support no-JS or not should be your call. If you think your userbase is likely to have a sizeable portion of people who disable JS, then you should give them a site that works, but not optimally. If you think most of them will be running with "normal" (air quotes are important there) browsers, then you may consider dropping support for no-JS users.
I am NOT a professional developer, so take my input accordingly. Here are my observations:
I support a website for a wedding cake vendor. Upon observing the competition, all the more appealing sites are embellished (tastefully) with slideshows, dropdowns, animations, interactive form validation, etc.
When scouting for methods to incorporate these features into our site, I found that mostly every classy method was based in javascript.
Figuring it was better to present ourselves as the classy act we are (humble smile), I have decided to require users to have javascript enabled. We've been up for 7 years, and I have not received any complaints. All work on mobile devices.
A compromise option is to start with your State drop-down populated with the states of whatever country your business is in, e.g., all US states, with an extra option (preferably at the top of the list) that says "Other, non-[yourcountrynamehere]". Next to the State drop-down have a text input where the user can type the name of their state if it's not in the list. If JavaScript is enabled then on document-ready you can hide the text input and go with your Ajax solution. Without JavaScript the user has a fully functional page that doesn't even need a reload.
What I ended up doing is to add a button beside the drop down that says "select country". Users without javascript will see this button. Upon clicking it, the page will reload with the list of states rendered.
For users without javascript, this button is hidden, and selecting a country will automatically render a new drop down containing the relevant states.
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.
I heard someone mention that one could theoretically position an invisible iframe on top of content and receive the input that someone wants to put in a form. How would this be possible and not get suspicion? It scares me...
Yes it is possible! It's called clickjacking, and is very real indeed. Check this out for more information: http://en.wikipedia.org/wiki/Clickjacking
Michal Zalewski, of Google, has a theoretically example (Source: Page 1, Page 2):
A malicious page in domain A may
create an IFRAME pointing to an
application in domain B, to which the
user is currently authenticated with
cookies," Zalewski said in a message
to a mailing list on Thursday. "The
top-level page may then cover portions
of the IFRAME with other visual
elements to seamlessly hide everything
but a single UI button in domain B,
such as 'delete all items,' 'click to
add Bob as a friend,' etc. It may then
provide [its] own, misleading UI that
implies that the button serves a
different purpose and is a part of
site A, inviting the user to click it.
It's not possible to do this without drawing suspicion, someone will always notice. If you're not a standard user, I would recommend you try downloading noscript (a firefox plugin). It prevents any website not on your personal whitelist from running javascript. This should alleviate a lot of your worries! I hope! I know it makes me feel better.
In the realm of possibilities, there are many stupid ideas. :-)
Theoretically, you can hijack a form and place a region that captures input. This is not a simple exercise, as you need to mimic the form or have the user step outside of the security box of the browser. It is far easier to phish with a look alike form than do this.
I see someone mentioned clickjacking, which hijacks the click event. Overall, this is different from the form capture, although it could be used to cover a button once a form was filled in. Once again, there it is similar to a phish attack, as you are hitting their site. Without this misdirection, they can't inject the JavaScript necessary to make this work.
What is your real concern? That someone can hit your site and be hijacked without another site on top? Unlikely. That people can be fooled. Well, PT Barnum taught us there is one born every day.