I wonder whether I need to ask the name or any identifier, such as email address, of the participant before the participant click "Yes" or "Agree" button.
Dear Colleague, you have here double problem. 1. how to provide the anonymity - so if this is the main than they should not provide any identifiers. and 2. how to make sure that each respondent answered the survey only once.
from your basic question i assume that you don't actually need consent form - since free-will participation in survey is consent in the act, unless you are dealing with something for what you need additional consent.
Regarding the technical/moral dilemma - consult some literature on online survey methodology.
Uros is quite right in the double concerns that were raised. I have found that a 2012 book by Bethlehem and Biffignandi, "Handbook of Web Surveys" that is published by Wiley is a fine resource. Especially, I believe, chapters 3 and 4 for your needs.
Dear colleague, Esomar (european society for opinion and marketing research) considered that anomynous answers is the "normal rule" for online survey.
More and more researchers consider that having an identifier -such as IP adress, but 2 people could not answer from the same computer- or email adress is a necessity to be sure (more sure) that o e people will not organised a team answeri g manytime so that it make your survey false and useless. Tbe fact is that it has to be used as a way to controle the double or multiple answers from one people but has to be not possible to be use after this controle i order to preserve the anonymity. They're some technical possibilities to do that. The refernece given by Jack could help you , also the Dora Toepoel's book "Doing survey online"