adwords conversion snippet rejected in Elgg

Goog adwords gives you a special conversion snippet to put only on ONE page - the post tranaction page (conversion page) to allow you to track purchases or special conversions. Basically this is used to track and ad click through conversion, and it is much more specific then general analytics.

The key is that the snippet must go between the body tags, so I tried copy and pasting in into a staticCMS page used for the conversion page. That page has tinyMCE as my editor. 

I open up the "HTML" view in tinyMCE and paste my code at the end of my text/bottom of the page, and the text gets garbled, destroying the snippet. The original code and mangled code are below. I'm trying to figure out my options, and I have a few.

1) Give up. tinyMCE/elgg will break my attempts at using the adwords conversion code

2) Have someone write a special plugin that will place the code on ONE page only. Ack.

3) Modify tineyMCE or find away to make a plugin for tinyMCE that will allow me to do this

4) Scrape by with Google analytics and do extra filters slicind and dicing of the data

5) Hack up some intermediate page that gets pulled and displayed with the code. Possibly a mix of #2 above and http://community.elgg.org/pg/forum/topic/655811/tracking-registrations-as-a-conversion-in-google-analytics-and-adwords/#annotation-2691362

Do any of those seem realistic? It would seem to be a useful business case to allow any Elgg site to track Google adword conversions. It's a shame that I can't do it out of the box.

----- original code ------

<!-- Google Code for reached post-registration Conversion Page -->

<script type="text/javascript">

/* <![CDATA[ */

var google_conversion_id = 1234565479;

var google_conversion_language = "ar";

var google_conversion_format = "2";

var google_conversion_color = "ffffff";

var google_conversion_label = "z6GxCMmVnQIQocH__QM";

var google_conversion_value = 0;

if (1) {

  google_conversion_value = 1;

}

/* ]]> */

</script>

<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js"&gt;

</script>

<noscript>

<div style="display:inline;">

<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/1069539489/?value=1&amp;label=z6GxCMmVnQIQocH__QM&amp;guid=ON&amp;script=0"/&gt;

</div>

</noscript>

----- end original code, the resulting code on the page looks like -----

<script type="text/javascript"><!--

/* <! [CDATA[ */

var google_conversion_id = 1234565479;

var google_conversion_language = "ar";

var google_conversion_format = "2";

var google_conversion_color = "ffffff";

var google_conversion_label = "z6GxCMmVnQIQocH__QM";

var google_conversion_value = 0;

if (1) {

  google_conversion_value = 1;

}

/* ]]--> */

// --&gt;

// --&gt;</script>

<script src="http://www.googleadservices.com/pagead/conversion.js" type="text/javascript"></script>

</p>

<noscript> &amp;amp;amp;lt;div style="display:inline;" mce_style="display:inline;"&amp;amp;amp;gt; &amp;amp;amp;lt;img height="1" width="1" style="border-style:none;" mce_style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/1069539489/?value=1&amp;amp;amp;amp;amp;label=z6GxCMmVnQIQocH__QM&amp;amp;amp;amp;amp;guid=ON&amp;amp;amp;amp;amp;script=0" mce_src="http://www.googleadservices.com/pagead/conversion/1069539489/?value=1&amp;amp;amp;amp;amp;label=z6GxCMmVnQIQocH__QM&amp;amp;amp;amp;amp;guid=ON&amp;amp;amp;amp;amp;script=0"/&amp;amp;amp;gt; &amp;amp;amp;lt;/div&amp;amp;amp;gt; </noscript>

  • #2 sounds like your best bet.  Basically any time you want a script on a page you should do it through a plugin for security reasons.

  • Thanks Evan.

    I guess I'll ask my IT guy to look into it. It might be useful for your Google Tools plugin someday.

    I thought of another option that's like #2, is a little kludgy, but should do the trick:

    I thought I saw a generic insert HTML plugin - could I use that to drop in the js code? Since it would be done by admin it would be more secure. The trick is to only apply that HTML plugin on one staticCMS.

  • I'd love to include something like that.  If your IT guy ends up coding something, tell him to fork https://github.com/ewinslow/elgg-google and submit a pull request with his changes.  I'd be happy to integrate them (and give proper credit of course).