Step 1 - Add jQuery via Site Header injection
Open your Ghost admin panel and navigate to Settings > Code injection. Paste the following script tag into the Site Header field. This loads jQuery, which the Linking Agent script depends on.
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"> </script>
If your Ghost theme already includes jQuery, you can skip this step. Check your theme source or look for jQuery in your page source before adding a duplicate.
Step 2 - Load the Linking Agent script in Site Footer
Still in Settings > Code injection, paste the following into the Site Footer field. Replace YOUR_API_KEY with the key provided by your onboarding team.
<script src="https://dev-dot-isentropic-snow-282609.ew.r.appspot.com/api/js-internal-linking/?apikey=YOUR_API_KEY"></script>
API key
Contact our onboarding team if you do not yet have an API key. You can also find it in the Linking Agent dashboard by entering a test URL and inspecting the X-API-KEY value in the request.
Production endpoint
The script URL shown above is a development endpoint. For your production environment and final API key, speak with your onboarding team. They will provide the correct endpoint for your site.
Step 3 - Add the container div to your post template
The Linking Agent script looks for a specific div element on the page to render links into. Open your post template file at:
current/content/themes/source/post.hbs
Add the following div where you want the internal links to appear. A common placement is below the post content, before the comments section.
<div id="similarai-relatedSearches"></div>
Once the div is in place and your code injection scripts are saved, the Linking Agent will automatically populate the container with relevant internal links on each post page.
If you are using a custom Ghost theme, the post template path may differ. Check your theme directory for the equivalent of post.hbs and place the div there.
Related guides
Depending on your setup, these guides may also be helpful:
Ready to add internal links to your Ghost blog?
Get the Linking Agent running on your Ghost site in minutes. Our team can walk you through the setup and provide your production credentials.