Skip to main content
Participant
April 19, 2016
Answered

Google ad word tracking code

  • April 19, 2016
  • 1 reply
  • 964 views

Hi,

I don't use CF too often and forget what little I did know.  I've been asked to insert some javascript into the header section of a CF page per the following:

<cfif FindNoCase("store.cfm?do=checkout&area=Purchase",cgi.http_referer)>

    <script type="text/javascript">

/* <![CDATA[ */

var google_conversion_id = 1070946261;

var google_conversion_language = "en";

var google_conversion_format = "3";

var google_conversion_color = "ffffff";

var google_conversion_label = "BslPCPb--mQQ1a_V_gM";

var google_remarketing_only = false;

/* ]]> */

</script>

<script type="text/javascript"

src="//www.googleadservices.com/pagead/conversion.js">

</script>

<noscript>

<div style="display:inline;">

<img height="1" width="1" style="border-style:none;" alt=""

src="//www.googleadservices.com/pagead/conversion/1070946261/?label=BslPCPb--mQQ1a_V_gM&guid=ON&script=0"/>

</div>

</noscript>

</cfif>

When I do, the page immediately pukes in CF 9.  I'm sure there is something I'm overlooking but just can't see it.  Any advice gratefully accepted.

Thanks!

--Ben

    This topic has been closed for replies.
    Correct answer bconner

    Ah geez.  I found it.  A comment prior to this code didn't have all 3 '-' in it in the closing string, which caused a large chunk of code to be commented out.  Sigh.

    Thanks!

    --Ben

    1 reply

    Carl Von Stetten
    Legend
    April 19, 2016

    Can you elaborate on "pukes"?  Do you get a ColdFusion error?  Does the page load in an unexpected way?

    bconnerAuthor
    Participant
    April 20, 2016

    Hi Carl,

    I get a 500 internal server error:

    Server Error

    500 - Internal server error.

    There is a problem with the resource you are looking for, and it cannot be displayed.

       ‹ í” Ê«‹¿ dñË%Ö{Ý‰Ú à$ýÖˆ?Ç?M Ä 4"ïýiOí¶‡HÑ`x9æ/1)/NÚãîHåEÎ# ˆˆF- „oe<áÒ õZ]Ç/8x4Ʊ(-Ä2iõ "D5QzJ› ú­ ⛨ãî E †œØÉô’?GÑÅåú

    ...

    Õ£Ò ‘›é‰èø×Ljì  XE£üQZÄfn´†¾ÈCÄA`5î ²¤1 ÷È ¿y38 „²HªSJëb¨DV·ñ'ìµG¥Ì¨Ä$cfATŸ2ñ`xNÊÕ0X · 2_ c  ÎÉPn ºý ýC „yC

    That's pretty pukey to me.

    bconnerAuthorCorrect answer
    Participant
    April 20, 2016

    Ah geez.  I found it.  A comment prior to this code didn't have all 3 '-' in it in the closing string, which caused a large chunk of code to be commented out.  Sigh.

    Thanks!

    --Ben