This package is part of the SeoToolkit package, but can be installed/used on its own! The SeoToolkit package is a v9/v10 package that combines multiple functionalities in one like redirects, meta fields, robots.txt and more. It is aimed at the idea of making SEO easier to use within your website and take less time to implement it.
Script Manager
Script manager easily allows your users to add new scripts to the website. They are able to quickly add Google Tag Manager or Hotjar with just a few clicks. It also gives them the ability for adding custom scripts if their script definition is not yet available.
Getting Started
You can get started with this package by downloading the following nuget package:
dotnet add package SeoToolkit.Umbraco.ScriptManager
If you are running on v10, use the 2.x versions. If you are using v9, use the 1.x versions.
After that, add the following line in your _ViewImports.cshtml
@addTagHelper *, SeoToolkit.Umbraco.ScriptManager.Core
After that, add the following tag helpers in your master template
At the bottom of the <head> tag
<render-script position="HeadBottom"></render-script>
At the top of the <body> tag
<render-script position="BodyTop"></render-script>
At the bottom of the <body> tag
<render-script position="BodyBottom"></render-script>
Documentation
Documentation can be found here: https://seotoolkit.gitbook.io/useotoolkit/
How to use
After installing, you should now see a new section called SeoToolkit. If you don't see it, you may have to give yourself access to it through the users section.
Then go to the Script Manager node and click on it. It'll now show an overview of all your scripts (if you have any)
Clicking create or edit will open up a new page where you can customize the script to your liking