Besides our server side integration, the Similar.ai internal linking API also works with a client side integration. You can simply put a script block in manually or add it via Google Tag Manager (GTM) and add an empty HTML element in your HTML template, e.g. in the footer. The script will pull the links with the API key we provide and update the HTML page automatically.

  1. The JavaScript block
    1. NOTE - contact us for the API key.
    2. NOTE - we are about to migrate the endpoint, contact us for the new URL before working on the integration.
<script src="<https://isentropic-snow-282609.ew.r.appspot.com/api/js-internal-linking/?apikey=XXX>" defer></script>
  1. Empty HTML element
<div id="similarai-relatedSearches" class="nav"></div>

For an example of one of our clients using this client side integration, look at Utility Bidder. You can find their internal links get pulled in and rendered, when you open a page such as https://www.utilitybidder.co.uk/business-electricity/

Untitled

Add script block with Google Tag Manager

  1. Go to the GTM tags and add a new tag:
<script>
  var script = document.createElement('script');
  script.defer = true;
  script.src = "<https://isentropic-snow-282609.ew.r.appspot.com/api/js-internal-linking/?apikey=XXX>";
  document.getElementsByTagName('head')[0].appendChild(script);
</script>
  1. Add a new trigger. For instance, this could be the page view event for pages that are supposed to pull the internal links from Similar.ai.
  2. Preview and Publish.