To do this, we first need to create custom fields. To see how to do this, please refer to this article.
Once you have created the fields that you want to use for learner registration, you will need to enable it in your course's Course Settings by clicking on Registration Fields.
In the window that pops up, simply check off the boxes for the fields that you want your learners to fill out when they register for a course.
When a learner tries to enroll via a web link, they will see the custom fields you checked off as being required.