Page 1 of 1

Google conversion code causes design errors (Iframe)

PostPosted: Thu Oct 08, 2009 7:00 am
by priyanka
Hi everyone

Just wanted to share an issue which I faced today.

In one of the projects I was working on recently, in all the thank you pages where we had the google conversion code included, for some unknown reason Mr.Google was placing an iframe to the DOM and as a result the pages' design were broken. I wonder how the G guys could come up with something like this.

Eventually making use of the YUI library I could tackle the issue. Do find the code snippet below

First include the following dependent files on our page

<!-- Dependencies -->
<script src="http://yui.yahooapis.com/2.8.0r4/build/yahoo/yahoo-min.js"></script>

<!-- Source file -->
<script src="http://yui.yahooapis.com/2.8.0r4/build/dom/dom-min.js"></script>

And then include the following code snippet

<script>
function hideframe()
{

var elements = document.getElementsByTagName('iframe');
elements[0].style.display = 'none';

}
hideframe();
</script>

A big thumbs down to Google CONVERSION CODE for causing this idiotic issue.....

Re: Conversion Code Issue

PostPosted: Fri Oct 09, 2009 5:58 am
by latha
Priyanka, excellent find. Thanks a lot for posting it here.

So the iframe in the http://www.googleadservices.com/pagead/conversion.js broke the design. And adding the YUI library (DOM) and suppressing iframe
you and your team have fixed it.

Excellent job guys.

Two questions why is this not in head
<!-- Dependencies -->
<script src="http://yui.yahooapis.com/2.8.0r4/build/yahoo/yahoo-min.js"></script>
<!-- Source file -->
<script src="http://yui.yahooapis.com/2.8.0r4/build/dom/dom-min.js"></script>

and

Does YUI cause any conflicts ?

Dumb questions but this would help.