help center

On this page

Add custom code using Elementor AI

Last Update: March 4, 2024

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.
    image 41 Add custom code using Elementor AI 1
  3. Click Add New.
    image 42 Add custom code using Elementor AI 3
  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.
    image 43 Add custom code using Elementor AI 5
  5. Select “Write an embed code of Google Analytics” from the suggested prompts.
    Custom code 1 1 Add custom code using Elementor AI 7
  6. Click Generate code.
    Custom Code 2 marked Add custom code using Elementor AI 9
    This will generate the following:
    Custom Code 3 Add custom code using Elementor AI 11
    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.
    Custom Code 4 Add custom code using Elementor AI 13
  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.
    image 47 Add custom code using Elementor AI 15

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.

Have more questions? We’re more than happy to assist.

Link is copied to clipboard!
On this page

Is this article helpful?

Share this article