Using Elementor AI to add Custom Code to your site

There are some functions that you want to apply to your entire site (e.g. Google Tag Manager and Facebook Pixels). You can use the Custom Code field in the WordPress dashboard to add these using Elementor AI.

Note:Elementor does not offer support for Custom code. Users are responsible for checking and debugging code produced by Elementor AI.

Adding Google Analytics using Elementor AI

  1. Go to the WordPress dashboard.
  2. Select Elementor>Custom Code.
  3. Click Add New.
  4. Select Write me code. (We’ll leave the location of the code in the header which is the default).
    Note: After your first use of Elementor AI, the Write with code text will be replaced with the Elementor AI icon.
  5. Select “Write an embed code of Google Analytics” from the suggested prompts.
  6. Click Generate code.

    This will generate the following:

    Note: This will generate the necessary code in addition to any extra steps you should take when using this code.
  7. Click Insert.
  8. Name your custom code. If you don’t name your code a numeric name will be assigned automatically.
  9. Click Publish to save the new code.
  10. If this is your first time adding custom code, the conditions window will open up. Otherwise, click Edit to determine under what conditions the code will appear. This is similar to setting conditions for popups and site parts.

Next Steps

If you want to review the other Elementor AI functions, read up on how to use Elementor AI to write text and how to use Elementor AI to write Custom CSS for elements and pages.

Share it on social networks

Was this article helpful?

Get Started With Elementor Today

Join millions of professionals who use Elementor to build WordPress websites faster and better than ever before

On this page