Automad allows you to inject custom HTML markup and JavaScript code into your site either globally or on individual pages. This capability enables seamless integration with third-party services such as analytics platforms and commenting systems.
To apply customizations site-wide, navigate to Global Data and Files → Customizations. Page-level customizations can likewise be applied and automatically merged with their global counterparts.
Integration Types
Depending on the content or script you want to integrate, you need to choose the right location for code injection. The following fields are available for adding custom code:
- Custom HTML in the head element — for meta tags, cookie consent wrappers, and conditionally loaded JavaScript or CSS files
- Custom HTML before the closing body tag
- Custom JavaScript in the head element
- Custom JavaScript before the closing body tag
GDPR Compliance
When integrating third-party services that set cookies for tracking user data, ensure your implementation complies with GDPR regulations. Refer to the Cookie Banner guide for instructions on implementing GDPR-compliant script integration.