How to remove Google Remarketing or Conversion iFrame white space

I have encountered a weird problem some time ago and I had to do some research to solve it. I was working on a website and added a Google Conversion iFrame code. Google recommends to add the conversion tracking tag between the body tags (). After that, I realized that the top of the website had a weird white space. That was looking ugly and I needed to remove that. I did some research on Google and found a CSS solution which was perfect.

I added the Google tag wrong because my white space was on top of the website, but some people mentioned that the space was in the footer and has 13px height or so. Anyway, on header or footer it is surely wrong. If you have that gap , everything looks wrong on website.

So, if you check the code which generates this white gap, you will notice it is an iFrame of 13px height and having the name google_conversion_frame. So the first CSS code I have tried was this one:

iframe[name='google_conversion_frame'] {
font-size: 0 !important;
height: 0 !important;
line-height: 0 !important;
margin-top: -13px;
width: 0 !important;
}

But I have noticed that this was not actually working fine as the white space generated by Google Remarketing or Conversion iFrame was still there. So I have discovered that adding float: left; to CSS will work perfectly. So the correct CSS code is:

iframe[name='google_conversion_frame'] {
font-size: 0 !important;
height: 0 !important;
line-height: 0 !important;
margin-top: -13px;
width: 0 !important;
float: left;
}

Just let me know if this CSS is working for you and if it removes that annoying white space generated by Google conversion tracking code. For this Google AdWords tracking code some people recommend to just add display:none; for iframe[name='google_conversion_frame'], but I would not recommend it.

Comments closed

Please contact me, if you have any questions or suggestions.