How to Add Tracking Code or Custom JS to Headers and Footers in Divi

You are reading this article because you want to know how to add custom scripts to the header/body/footer of a DIVI website.

DIVI makes it easy to add custom tracking codes to the whole website without additional third party plugins. This increases efficiency and security and keeps the codes in one place.

1. Log in to the WordPress Dashboard.

2. Navigate to Divi > Theme Options.

3. Go to the Integration tab.

4. You’ll see these fields:

     •Add code to the <head> of your blog: Paste your tracking code or custom JavaScript here for code that should appear in the <head> section.

     •Add code to the <body> (at the top): Insert code here if needed in the <body> section, such as Google Tag Manager snippets.

     •Add code to the <body> (at the bottom): Add your custom JavaScript or tracking codes here for the footer.

5. Save your changes by clicking the green Save Changes button.


  • divi, google analytics
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Increase Sub Menu Item Width in DIVI

DIVI is great but a frustrating thing is the sub-menus are a fixed width so the text does not fit...

WPML shortcode for language flags

How to make a shortcode for WPML language flags.To display the language flags in a shortcode, use...

How to Remove the Projects Post Type in Divi

Divi annoyingly adds a post type to their theme called "Projects".Add this PHP code snippet to...