AdWords
2.1K members online now
2.1K members online now
Use AdWords conversion tracking and reporting to measure your results. Have a question about Google Analytics? Post it here, on the Google Analytics Community!
Guide Me
star_border
Reply

uncaught syntaxerror unexpected token

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi, I get the following error "uncaught syntaxerror: unexpected token <" in Chrome Developer Tools: Resources Panel with the tracking code I copied and pasted from adwords.

 

Te code is the following:

function inquireyachtsidebar()
{
<!-- Google Code for Inquire Yacht Sidebar Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1004731422;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "auhECJr_4gIQnviL3wM";
var google_conversion_value = 1;
/* ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/1004731422/?value=1&amp;label=auhECJr_4gIQnviL3wM&..."/>
</div>
</noscript>
}

 

Any suggestions?

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by rashu (Google Employee)
September 2015

Re: uncaught syntaxerror unexpected token

Top Contributor
# 2
Top Contributor

Hi Germanliu,

 

At a quick glance, the part that looks odd to me is this:

 

<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/1004731422/?value=1&amp;label=auhECJr_4gIQnviL3wM&..."/>

 

I'm not sure if it is a function of a module/widget or whatever you are using to call this fuction and include the conversion code but it appears that there is a bit missing at the end of this tag.  See the ..."/>  If you view the conversion code in the AdWords UI (Tools > Conversions) - I bet you'll see that there is more to this line of code.

 

I'm not sure that this will cause the issue you are having but I would say it is worth looking at.

 

Hope this helps!

 

-Tom

Tommy Sands, AdWords Top Contributor | Community Profile | Twitter | Philly Marketing Labs
Did you find any helpful responses or answers to your query? If yes, please mark it as the ‘Best Answer.’

View solution in original post

Marked as Best Answer.
Solution
Accepted by rashu (Google Employee)
September 2015

Re: uncaught syntaxerror unexpected token

Top Contributor
# 2
Top Contributor

Hi Germanliu,

 

At a quick glance, the part that looks odd to me is this:

 

<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/1004731422/?value=1&amp;label=auhECJr_4gIQnviL3wM&..."/>

 

I'm not sure if it is a function of a module/widget or whatever you are using to call this fuction and include the conversion code but it appears that there is a bit missing at the end of this tag.  See the ..."/>  If you view the conversion code in the AdWords UI (Tools > Conversions) - I bet you'll see that there is more to this line of code.

 

I'm not sure that this will cause the issue you are having but I would say it is worth looking at.

 

Hope this helps!

 

-Tom

Tommy Sands, AdWords Top Contributor | Community Profile | Twitter | Philly Marketing Labs
Did you find any helpful responses or answers to your query? If yes, please mark it as the ‘Best Answer.’

Re: uncaught syntaxerror unexpected token

Collaborator ✭ ☆ ☆
# 3
Collaborator ✭ ☆ ☆

HI

Can you please tell us why you are using function inquireyachtsidebar()

 

Regards, Nik
LinkedIn  |   @nikhilparachure | My Blog

Re: uncaught syntaxerror unexpected token

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

PPC, Theniks, thanks to both.

 

The "..." after the img is correct in my code...it just went that way when I pasted into the forum.

 

function inquireyachtsidebar() is there because I have an ajax form which runs the function when the form is succesfully completed. I have researched and arrived to the conclusion that I will have to modify the tracking code as the <noscript> part won't work in a javascript function. I need to load the image by javascript. I appreciate if you have a way to do this.

 

Best regards!

German