Documentation

Installation Guide

Add the LinkWrangler snippet to your website to start handling GS1 Digital Links.

1. Add the Snippet

To integrate LinkWrangler, add the following script tag to the <head> or <body> of your HTML pages.

<script 
  src="https://linkwrangler.com/snippet.js" 
  data-snippet-id="YOUR_SNIPPET_ID"
  async
></script>

Where to find your Snippet ID

You can find your unique data-snippet-id in your LinkWrangler Dashboard:

  1. Navigate to Account in the sidebar.
  2. Select the Account Details tab.
  3. Scroll down to the Installation section.

2. GS1 Digital Link URL Recognition

By default, most web servers (Apache, Nginx, etc.) do not recognize the GS1 Digital Link URL structure (e.g., /01/9300000000001) and may return a 404 error if the page doesn't exist on your server.

You must ensure your server directs these paths to your main application or handles them as virtual paths so the LinkWrangler snippet can process them.

The "Hash Trick" (Simplest Method)

The easiest way to ensure your server ignores the GS1 path is to include a hash (#) at the end of your domain. This tells the server that the domain portion is finished, and the rest is client-side data.

https://yourdomain.com/#/01/9300000000001/...

Server-Side Redirection (Advanced)

For a cleaner URL structure (without the hash), you can configure your server to treat paths starting with GS1 identifiers (like /01/) as fallback routes.

Apache (.htaccess)

RewriteEngine On
# Redirect GS1 Digital Link paths to index.html
RewriteRule ^01/.*$ /index.html [L,QSA]
RewriteRule ^21/.*$ /index.html [L,QSA]

Nginx

location ~ ^/(01|21|10|17)/ {
    try_files $uri /index.html;
}

3. The 404 Page Solution (Catch-all)

If you are unable to configure your server routing rules, or if you want a guaranteed catch-all solution, you can simply add the LinkWrangler snippet to your website's 404 Error Page.

Because LinkWrangler reads the full URL of the request, it can still detect GS1 identifiers and perform the necessary redirections even from an error page.

  • How it works: When a user visits a GS1 path that doesn't exist, your server shows the 404 page. The snippet loads, sees the GS1 data in the URL, and instantly redirects the user before they even realize they were on an error page.
  • Setup: Ensure the same snippet code from Step 1 is present in your 404 template.