There are two primary options for sampling via online methods: web and email. These may involve selecting participants from a list of email addresses provided by a company or institution, posting your survey to a website or discussion group, or even paying for a pop-up advertisement on a website that asks viewers to opt-in to your survey. Furthermore, online methods may require you to use a combination of modes (telephone, email, mail) to reach your participants. However you decide to conduct your survey, remember that it is the mode of initial contact that matters for sampling, not how the participants end up responding to your survey.
When conducting research surveys online, probability methods (e.g., simple random sampling or stratified sampling) are limited. To use probability methods, you will generally need to take your sample from a list of email addresses rather than post your survey on a website, which would be a convenience method. To generate a random sample, you could enter email addresses into a spreadsheet, and then randomize it to get a list of contacts. This list of emails may be both your sampling frame and population of inference, since you are only able to reach those in the target population that have an email address. If you are trying to generalize your results to a broader population, you may need to employ a mixed modes strategy, so that you can reach those who do not have an email address or even Internet access (Fricker, 2017). For stratified sampling, you need to have access to additional information besides just email addresses in order to pull from the appropriate stratum.