0
votes

I'm installing Google AdWords conversion tracking code on my site, and noticed that part of the code that Google provides uses & in a URL query string. E.g.

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

However, a Google AdWords support page shows & being used instead of &amp; (expand "Track conversions on your website", then expand "Step 2", then see the last few lines of the 2nd code block)

<img height=1 width=1 border=0 src="http://www.googleadservices.com/pagead/
conversion/1234567890/?value=10.0&label=Purchase&script=0">

Should I be using &amp; or & ?

1

1 Answers

0
votes

Most modern browsers will probably let you get away with just &, but according to the HTML specification, you have to use the character entity reference &amp;.

You can check for yourself using the W3's validator (http://validator.w3.org); when not using &amp; it will complain "cannot generate system identifier for general entity "label"".