Widgets bring a learning path right into your own website, product or app. Learners open it from a button on your page, or take it inside a section of the page, without going anywhere else.
There are four widget types:
• Sidebar Widget: the learning path slides in from the left or right when someone clicks your button.
• Modal Widget: the learning path pops up in the middle of the page.
• Direct Link Widget: your button opens the learning path in a new tab or the current one.
• Embed Widget: the learning path sits inside a section of your page.
ℹ️ Widgets are available on the Growth plan and above. On other plans, the Widget section shows a See Plans & Upgrade button instead.
Where to find widgets
Go to Paths, open your learning path and click the Share tab. Then select Widget on the left.
Pick a widget type from the tabs at the top. A live preview button shows how the widget behaves, so you can try it before you copy anything.
Every widget gives you two pieces of code:
• HTML: place this element where you want the widget to appear, for example as a button. Click Copy HTML code.
• JavaScript: place this code just before the closing </body> tag of your page. Click Copy JavaScript code.
💡 Widgets open the learning path's Direct link. If your learning path has its own custom domain, the widget uses it too.
Sidebar Widget
Set the Title shown at the top of the sidebar, the Theme (Light or Dark), the Position (Left or Right) and the Width (px).
Then copy the HTML and JavaScript code to your page. The HTML is a ready-made "Academy" button. You can change its text and style to match your site.
Modal Widget
Set the Title, the Theme (Light or Dark) and the Max Width (px) of the pop-up.
Copy the HTML and JavaScript code to your page, just like the Sidebar Widget.
Direct Link Widget
Choose the Direct Link Target:
• _blank opens the learning path in a new tab.
• _self opens it in the current tab.
Copy the HTML and JavaScript code to your page.
Embed Widget
The Embed Widget shows the learning path inside your page, so learners take it without leaving your site.
• Click Copy HTML code and place the element where the learning path should appear. It takes the full width of its container.
• Click Copy JavaScript code and place it before the closing </body> tag.
Recognize your signed-in users
If people sign in to your own website or app, the widget can recognize them, so their progress is saved and shows up in your reports under their name. The widget code has optional fields for this:
• userName (data-mcg-user-name in the HTML): the email address of the signed-in user.
• nameSurname (data-mcg-name-surname): their full name.
• attributes (data-mcg-attributes): extra details, like a plan or a role. Each one becomes its own column in your analytics report.
Fill these fields from your site's code with the details of whoever is signed in at that moment. For example, in the Embed Widget's JavaScript:
nameSurname: "Jane Doe", // the signed-in user's name
userName: "jane@example.com", // the signed-in user's email
attributes: { "plan": "premium", "role": "admin" }, // optional⚠️ Whoever's email is in userName is signed in automatically. Before you publish the code, replace the values in userName and nameSurname with your signed-in user's details, or delete those lines. Never leave a fixed email address there.
If you remove these fields, visitors open the learning path like on any other page, and its Learners' authentication setting decides whether they need to sign in.
Frequently asked questions
Can I use widgets if my learning path is gated?
Yes. With Email verification or Invitation only, learners who aren't recognized are asked for their email address inside the widget. They receive a code, enter it, and then take the learning path right on your page. With Invitation only, only the learners you added can get in.
You set this in your learning path under Settings › Learners' authentication. See Email verification and Invitation only.
Can I use widgets with Paid access?
Not smoothly. With Paid access, learners finish their payment on the payment provider's page, so they leave your site and the widget experience is interrupted. If you sell access, share the learning path's link instead, so the payment and access flow stays in one place.
What's the difference between a link and a widget?
A link opens the learning path on its own page, on our domain or your custom domain. A widget brings it into your page: as part of the page (Embed Widget), or when someone clicks your button (Sidebar, Modal and Direct Link). See Sharing a Learning Path with a Link.
Is the publicKey different for each learning path?
No. The publicKey belongs to your workspace and is the same for all your learning paths. Only the learning path id changes.
❓ Please reach out via the Blue Chat bubble in the bottom right corner of your screen if you have any questions about widgets.

