Google conversion code causes design errors (Iframe)

Programming for Search Engines 101. An area for avid PHP and .NET developers to chat about Programming techniques and how to make better use of search engines.

Moderator: Moderators

Google conversion code causes design errors (Iframe)

Postby priyanka » Thu Oct 08, 2009 7:00 am

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.....
Last edited by priyanka on Fri Oct 09, 2009 6:17 am, edited 1 time in total.
priyanka
 
Posts: 3
Joined: Mon Jan 07, 2008 5:33 am
Location: kochi

Re: Conversion Code Issue

Postby latha » Fri Oct 09, 2009 5:58 am

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.
latha
 


Return to Programming

Who is online

Users browsing this forum: No registered users and 3 guests