What you need to bear in mind here is that you need to view your site as published page first, then copy its URL. You need to make sure that the last words in the URL are the words in your webpage title.
Category: Google Classroom
How to join Google Classroom using a class code?
There are three ways where you can join a Google Classroom: class link, class code, email invite.