Sometimes you need to add custom JavaScriptA programming language used to create interactive elements o... More to your Elementor site, for animations, calculators, Google Analytics, TagA non-hierarchical keyword used to describe specific details... More Manager, or other third-party tools.
The good news? It’s easier than you think. You don’t need to be a developer.
This guide covers three simple methods, from free options to Elementor Pro features.
JavaScriptA programming language used to create interactive elements o... More runs in the browser and adds interactive features that Elementor’s drag-and-drop builder doesn’t offer natively.
Common use cases:
Now let’s get to the methods.
This method works with the free version of Elementor. It adds scripts to individual pages, not site-wide.
Step by step:
<script> tags:<script>
// Example: scroll to top button
let button = document.getElementById("back-to-top");
window.onscroll = function() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
button.style.display = "block";
} else {
button.style.display = "none";
}
};
button.addEventListener("click", function() {
window.scrollTo({ top: 0, behavior: "smooth" });
});
</script>
Best for: Page-specific scripts (one-off features, custom buttons).
Limitation: The script only runs on pages where you add the widgetA small block that adds specific content/functionality to wi... More.

If you have Elementor Pro, the Custom Code feature lets you add scripts site-wide, perfect for Google Analytics, tracking pixels, or global libraries.
Step by step:
<script> tags).Best for: Site-wide scripts, tracking codes, third-party libraries.
Pro tip: Place scripts in the footerFooter The bottom section of a website, often containing cop... More (</body> end) whenever possible to avoid slowing down pageStatic content (e.g., "About Us," "Contact") not part of chr... More load.
Don’t have Elementor Pro? WPCode (formerly “Insert Headers and Footers”) is a free pluginSoftware that adds specific features or functionality to a W... More that adds headerThe top section of a website, usually containing the logo, n... More/footer scripts to your entire site.
Step by step:
Best for: Site-wide scripts without Elementor Pro.
Bonus: WPCode includes a library of pre-made snippets (Google Analytics, custom CSSCSS (Cascading Style Sheets) is a language used to style and... More, etc.).
Adding scripts to Elementor doesn’t require coding expertise. You have three solid options:
Start with the simplest method that fits your needs. Test on staging first. And always wrap your JavaScriptA programming language used to create interactive elements o... More in <script> tags.