Install the JavaScript Snippet

Introduction #

To enable our link affiliation and embedded widget services on your site, you need to add our JavaScript file. This script is essential for the seamless integration and functionality of our tools on your website. Follow the steps below to add the script to your site.

Step 1: Generate your snippet #

In the Spiffylinks dashboard, navigate to Settings → Properties, find the property for which you want to generate the snippet, and open the snippet generator.

The snippet generator offers several settings:

  • Custom Domain: The domain that will be used to shorten your page links and widget links.
  • Link Style: The format of your short links.
    • Concise example: https://ltl.gg/p/51215/iD3qmZDhfY
    • Detailed example: https://ltl.gg/p/51215/iD3qmZDhfY?u=https%3A%2F%2Fwww.amazon.com%2Fdp%2FB077MZ2MPW
  • Page Link Affiliation: Whether Spiffylinks will automatically affiliate and shorten links on your website.
  • Widgets: Whether Spiffylinks widgets that you have added to your pages will be displayed.

Once you have selected your settings, copy the generated snippet.

Step 2: Add the snippet to your site #

The snippet must now be added to the <head> section of your website. Instructions for various content management systems are provided below.

Several WordPress plugins allow you to conveniently add code snippets to the <head> section of your website. You may already have a plugin installed that provides this functionality.

If you don’t already have a code snippets plugin, install and activate one. We recommend WPCode.

  1. In the WordPress Admin, find the Code Snippets option in the left sidebar.
  2. Hover over Code Snippets and select Header & Footer.
  3. Paste the JavaScript snippet into the Header section and save the changes.
  1. Log in to your Squarespace dashboard.
  2. Navigate to Settings → Developer Tools → Code Injection.
  3. Paste the JavaScript snippet into the Header section and save.
  1. Log in to your Wix dashboard.
  2. Navigate to Settings → Advanced → Custom Code.
  3. Select to Add Code to the Head section.
  4. Paste the JavaScript snippet and apply those changes.

If your CMS is not listed above, you should still be able to install the JavaScript snippet on your site. Check if your CMS has instructions for adding external JavaScript files, or contact us for assistance, and we will guide you through the process.