Results 1 to 7 of 7
  1. #1
    ABW Ambassador isellstuff's Avatar
    Join Date
    November 9th, 2005
    Location
    Virginia
    Posts
    1,659
    Avoiding Double Encoding Datafeed Data
    Arghhh, so I just noticed my website's snippets in Google/Bing looked horrible because of double encoding problems. I evidently introduced this problem last year! Something like an encoding issue doesn't exactly scream "trust this website"....

    I thought I would recap the issue so everyone can learn. Basically ampersands, single quotes, double quotes, less than, greater than, etc need to be encoded when they are inserted into HTML. You never know what you are going to get from a datafeed, e.g. it could be already encoded, or not...

    I usually use a "decode" then "encode" strategy to deal with the unknown state of the data. The idea is to get the down to the "raw text", then re-encode so that everything is encoded only once. A decode->encode strategy becomes very important when you munge together data from multiple sources.

    My website evidently had a pathway that skipped the decode step for a fair number of pages. The end result was some really cryptic looking snippets being displayed to users in the search engines. Yikes!

  2. Thanks From:

  3. #2
    Moderator MichaelColey's Avatar
    Join Date
    January 18th, 2005
    Location
    Mansfield, TX
    Posts
    16,232
    Great tip!

    And it doesn't hurt to decode twice before you encode. You never know if the merchant might have double-encoded it.

    I find it best to treat each datafeed separately. I'd love it if every datafeed followed a standard, but they don't. Even within a network. Every merchant does something a little different. It can be a nightmare to work with all those inconsistencies.
    Michael Coley
    Amazing-Bargains.com
     Affiliate Tips | Merchant Best Practices | Affiliate Friendly? | Couponing | CPA Networks? | ABW Tips | Activating Affiliates
    "Education is the most powerful weapon which you can use to change the world." Nelson Mandela

  4. Thanks From:

  5. #3
    ...and a Pirate's heart. Convergence's Avatar
    Join Date
    June 24th, 2005
    Posts
    6,918
    We treat each feed separately - decode and strip html. THEN cleanup gets underway: Removal of phone numbers, drop all "call for price", duplicate promotional text, etc...
    Salty kisses, Sandy toes, and a Pirate's heart...

  6. #4
    ABW Ambassador isellstuff's Avatar
    Join Date
    November 9th, 2005
    Location
    Virginia
    Posts
    1,659
    I just implemented Michael's double decode tip, it makes sense. Trying to deploy it right now and of course Softlayer's API is down so I can't do take my servers out of rotation on the load balancer. Frustrating.


    BTW, I'm processing about 1,100 datafeeds, so I don't currently do any "merchant specific" stuff, just general rules that can apply to every one. I really dislike it when a merchant says something like, "I've changed the meaning of column X in the datafeed so you can have more data". I'm like, "You did WHAT!!????!!!"

  7. #5
    Moderator leeann's Avatar
    Join Date
    January 18th, 2005
    Posts
    2,955
    How do you decode an encode a datafeed? I do it the old fashion way I guess.. Find/Replace. Is there a faster way?
    leeann


    Shoppers determine what has value and they like coupons. Stop manipulating who set the cookie just because you do not like coupon and promotional sites.

  8. #6
    ABW Ambassador isellstuff's Avatar
    Join Date
    November 9th, 2005
    Location
    Virginia
    Posts
    1,659
    Quote Originally Posted by leeann View Post
    How do you decode an encode a datafeed? I do it the old fashion way I guess.. Find/Replace. Is there a faster way?
    Its something you would do in a programming language. So for instance, in c# .NET, it is:

    HttpUtility.HtmlEncode(HttpUtility.HtmlDecode(HttpUtility.HtmlDecode(input)));

  9. #7
    Moderator leeann's Avatar
    Join Date
    January 18th, 2005
    Posts
    2,955
    Quote Originally Posted by isellstuff View Post
    HttpUtility.HtmlEncode(HttpUtility.HtmlDecode(HttpUtility.HtmlDecode(input)));
    Oh, hmm, I see.
    leeann


    Shoppers determine what has value and they like coupons. Stop manipulating who set the cookie just because you do not like coupon and promotional sites.

  10. Thanks From:

  11. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. encoding url with php
    By acpd in forum Commission Junction - CJ
    Replies: 0
    Last Post: August 10th, 2010, 01:11 AM
  2. Replies: 4
    Last Post: June 23rd, 2009, 07:39 PM
  3. Avoiding Merchants Who Go Offline !
    By JMaxE in forum ShareASale - SAS
    Replies: 3
    Last Post: April 22nd, 2007, 08:22 PM
  4. Avoiding the SPAM trap
    By jhardy in forum Spam
    Replies: 14
    Last Post: October 25th, 2004, 08:31 PM
  5. encoding url's?
    By cjk in forum Programming / Datafeeds / Tools
    Replies: 1
    Last Post: May 12th, 2004, 09:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •