Support » Plugin: Elementor Website Builder » Elementor page builder causing issues with google adsense blogs on live pages

  • Resolved Gaga

    (@zskyla)


    All pages created with elementor causes issues with google adsense.

    When elementor is deactivated the pages with ads are completely normal, and full width when elementor is activated the pages shrink in size and the ads break past the page. Things like margin, width, padding, etc aren’t applied at all, and all the styling with Elementor is completely broken.

    This only goes away if elementor is deactivated.

    I have tried swapping out my theme to see if it was a theme issue. I used 6 different themes, and the issue only stops when elementor is inactive.

    Is there a way to stop this issue?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Gaga

    (@zskyla)

    Elementor is installed in over 60 client sites who are running adsense with the exact same issue. I believe the tag !important on every single element/widget being generated by elementor is causing this issue.

    Thread Starter Gaga

    (@zskyla)

    Alright I found out how to fix it myself as I always do.

    If you guys have trouble with google adsense + elementor here’s my fix/what worked for me. You need to overide the css with your own.

    The code below in quotes is generated by Elementor and causes issues with Google adsense:

    “height: auto !important;” causes reckless behavior and issues with other styles/widgets or shortcodes that you may use with elementor.

    For my client sites it was Specifically the

    elementor-widget-container {
    height: auto !important;
    
    }

    That was causing issues with any widget or shortcode added to the page.

    I was using a plugin called “Ad Inserter” (which wasn’t the issue since even adding the adsense code with Elementor’s own shortcode widget caused issues on the page…the exact same squished page, extremely huge ad sizes breaking past the page, along with a huge blank white space on the right side. The css looked morphed and wonky. All the margin/padding, height, etc was overridden with the horrible !important generated by Elementor).

    This is the code I used to temporarily fix the issue:

    .elementor-widget-container .code-block {
        height: auto;
    }

    But using this code instead will do, and work on all the widgets having size issues:

    .elementor-widget-container {
        height: auto;
    }

    This will allow your elements to use it’s own width, and height instead of forcing elementor’s weird morphed messed up code that causes the conflicting code issue with the !important tag.

    Alright I hope this helps some of you with the same issue as me. By the time you see this post Elementor support may have fixed this issue (or not, but I hope they do).

    Thread Starter Gaga

    (@zskyla)

    Oh, and you can insert the css with a plugin called custom css/js or even code snippets!

    Thread Starter Gaga

    (@zskyla)

    Alright, it’s a new day, and after further investigation of other client sites as well as a fresh install to test this issue the css fix was a temporary band-aid.

    The real issue with google adsense + elementor clashing is without a doubt the Javascript.

    The “stretch the section to the full width using javascript” option in elementor clashes with google ad’s own javascript (but doesn’t cause issues in preview mode which is strange), and that is why it causes a CSS issue where the page looks distorted, and messed up.

    This issue is made worse if adding google adsense javascript code to elementor’s “sidebar” widget.

    Simply switch the option “stretch section” off in the elementor editor (for sections) if you are using google ads + the sidebar widget (or google ads in general), and are having issues. This should help stop the problem.

    Hopefully this update helps anyone having issues with Elementor, and google ads in their blogs or on client blogs.

    • This reply was modified 1 year, 7 months ago by Gaga.
    • This reply was modified 1 year, 7 months ago by Gaga.

    Hello I am not sure if my problem is the same as yours, but on my website https://carte-gps.com/ I have tried to get adsense … and it does not seems to work…

    Thanks and goooo Elementor it is insane, I like it

    [Edit: soryr after posting, I have seen that it is resolved and I sould not have done that … I keep it in case there is an answer]

    • This reply was modified 1 year, 5 months ago by cvacances. Reason: edit as resolved
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Elementor page builder causing issues with google adsense blogs on live pages’ is closed to new replies.