Adding Locadapt to your localhost
project
Add Locadapt scripts
Add Locadapt scripts
To use Locadapt in your local development environment, add these two script tags to the You can find these scripts ready to copy, along with your project ID, on the Configuration page for your Locadapt project.
<head>
of your HTML file:Set up local development key
Set up local development key
To enable Locadapt on localhost or other non-production domains:Replace
- Navigate to the Configuration page in your Locadapt dashboard.
- Find the “Local Development” section with a JavaScript snippet containing your secret key.
- Copy and run this snippet in your browser’s console while on your local development site:
YOUR_SECRET_KEY
with your actual secret key or copy the entire snippet directly from your dashboard.This sets a cookie allowing Locadapt to function on test domains.Deploying to production
When deploying Locadapt to your own production site:- Navigate to the Configuration page in your Locadapt dashboard.
- Go to the “Options” tab.
- Configure the allowed domains for your project (similar to CORS settings).
- You won’t need to use the secret key for your own production domains.
Testing on foreign production sites
Testing on live sites you don't own
Testing on live sites you don't own
For testing Locadapt on live production sites that you don’t own or control (such as for client demos or our own demonstrations), you can use a browser extension similar to Tampermonkey:
- Install the Tampermonkey extension for Chrome (or a similar extension for your browser).
- Contact Locadapt support for a compatible user script.
- Install the script into Tampermonkey.
- Add your API key to the site’s
localStorage
(same as optional step 3, local development, on the configuration page). - Enable the script when visiting the site.
Best practices
Use version control
Track changes and collaborate by keeping your Locadapt configuration in version control.
Secure your key
Never commit or share your local development key. Use environment variables or secure vaults for sensitive information.
Stay updated
Regularly check for updates to Locadapt’s scripts and documentation for the latest features and best practices.
Leverage our support
Reach out to our dedicated support team for any questions or assistance during your development process.