Choose the space you want to have the badge for from your dashboard.
Once you are in your space, from the left sidebar, select the "Badge" option under the Embeds & Metrics tab.
A pop-up will show up, like the modal below, where you can customize your badge.
Once the modification is done, you may copy the code and have it embedded on your page.
Can I add a custom message to my badge?
Yes, you can. Check the "Use a customer message" option for the field to show and have it customized.