Overview
Get first alt text
Chrome extension
WordPress plugin
Developer API
Web snippet
Writing styles
E-commerce mode
Best practices

Web snippet: Installation

Web snippet can be installed on your website in several ways.

Basic installation

The simplest way to use Web snippet is to copy the web snippet from your AltTextLab dashboard and paste it into your website.

Place the code before the closing </head> tag to ensure it loads properly.

For most users, this is all that is needed.

Alternative installation methods

You can also install the snippet through Google Tag Manager by creating a new “Custom HTML” tag and pasting the code inside. This allows you to manage deployment without editing your site’s source code.

Advanced installation & configuration

The web snippet supports several configuration parameters that allow you to control how script behaves:

<!-- AltTextLab tag (alttextlab.com) -->
<script src="https://cdn.alttextlab.com/embed.js"
  data-site-id="your_site_id"
  data-public-key="your_public_key"
  data-lang="en"
  data-style="neutral"
  data-min-natural-size="50"
  data-delay="0"
  defer
></script>

Required parameters

  • data-site-id and data-public-key
    These values are generated automatically for your site.
    Do not remove or change them. Web snippet will not work without them.
  • data-lang
    Defines the language used for generated alt text.
    Useful for multilingual websites: set the parameter dynamically to match the visitor’s current language (e.g., "en", "es", "fr"). All supported languages.
  • data-style
    Controls the writing style of the generated alt text.
    The snippet can be configured dynamically based on the page type, template, or user contextFor example, you can set descriptive style on your blog pages, and use minimal on your product or landing pages. All writing styles.

Optional parameters

  • data-min-natural-size
    Defines the minimum image size (in pixels) to process.
    • Default: 50 – ignores small decorative images such as icons.
    • Example: data-min-natural-size="100" will ignore all images smaller than 100px.
    • To disable this behavior and generate alt text for all images, set data-min-natural-size="0".
  • data-delay
    Sets a delay (in milliseconds) before the script starts processing images.
    • Default: 0 (runs immediately).
    • Example: data-delay="1000" – script starts 1 second after page load.
    • Useful if you want to control script execution timing for performance reasons.

With these options, you can fine-tune Web snippet to match your website’s content strategy, accessibility goals, and performance requirements.