When you add a URL activity to a course, you have the option to append variables to the url. See https://docs.moodle.org/32/en/URL_resource_settings
Turn editing on, click 'add an activity', choose 'URL'. In that form, scroll down the section headed 'URL Variables' and choose the variable/s you want to append.
You can choose from
Course
- id
- Course full name
- Course short name
- Course ID number
- Summary
- Format
URL
- id
- cmid
- Name
- ID number
Miscellaneous
- Full site name
- Server URL
- Time
- Language
User
- id
- Username
- ID number
- First name
- Surname
- User full name
- Email address
- ICQ number
- Phone
- Mobile phone
- Institution
- Department
- Address
- City/town
- Timezone
- Web page