Google AdWords: remove iframe by adding tracking conversion code

I want to add Google AdWords to my site, but the script I have to add creates an iframe in dom. This iframe is visible and moves 13px (its height) my entire page.

Is there any way to avoid this? If not, can I hide it without affecting the functionality of Google AdWords? (This is an empty iframe).

+54
google-adwords
Aug 13 '12 at 17:56
source share
5 answers

There is an easy fix that does not affect the functionality of the code fragment. I did this without side effects. Just put the script in a hidden div as shown below and it should do the trick:

<div style="display:none"> <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"> </script> </div> 
+94
Aug 24 2018-12-12T00:
source share

@Mario is correct that there is a parameter that will allow you to turn off this screen. However, this parameter does not exist in the Google user interface for remarketing tags, although they display this iframe (I think this is an error at the end of Google, since I believe that the google_remarketing_only = true flag should turn this iframe off and does not work correctly).

I found out that you can also set this in tracking JS by manually adding the flag "google_conversion_format = 3", for example:

 <script type="text/javascript"> /* <![CDATA[ */ var google_conversion_id = 0123456789, google_conversion_label = "XXXXXXXX", google_custom_params = window.google_tag_params, google_remarketing_only = true, google_conversion_format = 3; /* ]]> */ </script> <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"></script> 

It can be easier if you regenerate tags for some people and solves the problem if the user interface does not support setting this parameter when creating tags.

+24
Aug 14 '13 at 20:13
source share

Usually I add this CSS (3) rule to the stylesheet:

 iframe[name=google_conversion_frame] { display: none !important; } 

Hope this helps.

+18
Jan 14 '14 at 16:27
source share

you can also set max-height: 0; instead of displaying: none; Not sure iframe display is not showing. This works before ie6.

 iframe[name="google_conversion_frame"] { display: block; max-height: 0; } 
0
Aug 11 '17 at 11:36 on
source share

The best and simplest solution I came across in this problem is to simply remove the frame from the document stream by adding the following code to the css stylesheet:

 iframe[name="google_conversion_frame"]{ position:fixed; } 

Hope this helps

0
Sep 08 '17 at 16:18
source share