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 General Settings by clicking on Data Collection.
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.
If you enable a field while learners are currently enrolled, the next time they try to start a course, they will see a field prompting them to fill in the information before they can continue.