Universal HTML / JS Snippet
Using our Sites feature, you copy + paste a small piece of HTML code into your web pages, and we'll automatically generate and serve alt text for your images. That's all you need to do -- no complex integrations, no API calls....just add the code snippet and you're done!
Requirements
To use the Sites feature, you'll need to be on an active recurring subscription plan. This is because we not only generate the alt text for any images on your pages, but we also continuously serve that alt text in real time into your web page HTML. So your account will need to be active in order for us to support real-time serving of alt text to your website.
Creating a Site
You'll need to let us know the domain name of your website that will be needing alt text. We'll create a custom HTML code snippet that you copy + paste into your pages.
- Go to the Account: Sites page in your AltText.ai account.
- Click the button to create a new Site.
- Enter the domain name where your web pages are served. If you have subdomains that also need alt text, you can
use a wildcard (
*
) as well. Example:www.mysite.com
, or*.mysite.com
- Click the Create button, and you will see your site in the list of all sites for your account.
Adding the HTML Snippet
When you add the HTML snippet to your web pages, you will start to get alt text added to any image which is currently missing alt text.
- From your list of sites, you will see the HTML Code that is needed. Click the Copy button to copy the code to your clipboard.
- In your web page code on your site, paste the HTML snippet anywhere in the
<head>
section of your site. The snippet needs to be on all pages where you want alt text added to images. If you're unsure how to do this, ask your web developer for help. - That's it -- you will start to get alt text added to your images on your site!
How It Works
Once you add the HTML Snippet to your site, any time a browser (or Google) loads your web page, a request will be made in the background to get alt text from our servers.
First Request
The very fist time a request is made to your site, we will start to generate alt text for your images. This first request will not result in alt text being added, since it takes a few seconds per image to generate alt text and we don't want your site to hang while that is happening.
Subsequent Requests
Once alt text has been generated for your images, any requests to your pages after that will immediately result in the generated alt text being added to your images.
Note
If you are testing the snippet on your site, remember the first request you make will not add alt text. Try making your second request after 20-30 seconds, in order to allow enough time for alt text generation to happen.
Account Changes
If your account status changes, alt text served from our HTML Snippet may be affected. Here are some common account changes and how they affect alt text served to your sites through our code snippet:
- Account No Longer on a Paid Subscription Plan
- Alt text will no longer be added to images on any sites using the HTML snippet.
- No new Sites can be created until the account is back on a paid plan.
- Account Deleted
- Alt text will no longer be added to images on any sites using the HTML snippet.
- Ideally the customer (you) should remove the HTML snippet from your site.
- Account Has No More Credits
- Existing alt text that has already been generated will continue to be served.
- No new alt text will be generated for images on the website.
- Once more credits are added, it may take up to 1 hour for new alt text to be generated and served.