Encoding Ampersands (&) in CJ URLs

Discussion in 'Commission Junction' started by Masterful, Oct 27, 2007.

  1. #1
    I have instances of ampersands (&) in some of my CJ content links. When I check if the markup of the web pages which include these links is valid, the ampersands are brought up as being errors. Apparently, unless they are "encoded", ampersands are not allowed. Encoding an ampersand simply means changing it to this:

    &

    Here's my question . . .

    If I encode my ampersands, will the links' tracking still work?
     
    Masterful, Oct 27, 2007 IP
  2. Masterful

    Masterful Well-Known Member

    Messages:
    1,653
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    140
    #2
    Anyone know anything about this?
     
    Masterful, Oct 28, 2007 IP
  3. hanji

    hanji Peon

    Messages:
    612
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hello

    URLEncoded ampersand is not &. & is a html entity for special characters in HTML markup. This will not work, because there is still a '&' in the string.

    URLEncoded value for ampersand is %26

    Hope this helps.
    hanji
     
    hanji, Oct 28, 2007 IP
  4. Masterful

    Masterful Well-Known Member

    Messages:
    1,653
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    140
    #4
    Thanks for your help, Hanji!

    However, you've left me totally confused. :confused:

    This is the message I get when I try to validate my web page:

    "Line 118, Column 88: cannot generate system identifier for general entity "adid".
    …y.com/gateway.aspx?sid=indextextlink&adid=17662&aid=10390122&pid=2373353&sURL
    The most common cause of this error is unencoded ampersands in URLs as described by the WDG in Ampersands in URLs."


    And on the Ampersands in URLs page, it says:

    "To avoid problems with both validators and browsers, always use & in place of & when writing URLs in HTML:
    <a href="foo.cgi?chapter=1&amp;section=2&amp;copy=3&amp;lang=en">...</a>"


    All I want to know is, if I change the ampersands in all my CJ links to &amp;, will the tracking still work? Apparently, if you do this with Amazon links, tracking functionality fails. Is it the same with CJ links?

    I've contacted CJ to see what they have to say.
     
    Masterful, Oct 28, 2007 IP
  5. MrX

    MrX Well-Known Member

    Messages:
    1,563
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    140
    #5
    You can keep them as they are if they are just links in the html. They will work fine.
     
    MrX, Oct 28, 2007 IP