Join Free
+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 17 of 17
  1. #11
    $_GET["parameter"] <-- contains %2B

    $variable = urldecode($_GET["parameter"]); <-- now it's +

    So in their backend code, meaning PHP programming taking a variable from the query string, they CONVERT %2B to +

    So if they expect %2B and NOT +, what do you think will happen if they get + instead of %2B? *nothing* will happen.

    If you were linking DIRECTLY to that link, it would work, because YOU pass them %2B, however, you deep link through Prosperent, and when Prosperent sends them the link, they decoded %2B to + already, so the merchant gets +, and not the expected %2B that they need for their programming to pull records.

    There's absolutely nothing you can do to make Prosperent not do that, and as Andrew pointed out, he is playing around to see if using rawurldecode will work in this scenario without breaking deep linking for everyone else. So if they fix it, if you send %2B as part of the required query string for the merchant to return search results, so will Prosperent redirect it properly so that the merchant gets the values they expect.

  2. #12
    Ok, here is my 'take' on the issues we seem to be discussing:

    I get that Prosperent is converting(ie decoding) the %2B to a + and that Scorebig is expecting a %2B - therefore it doesn't work.
    I don't get that the same thing doesn't happen to the %2F. In that case Prosperent converts it to a / but Scorebig apparently isn't expecting a %2F because the / works for them.

    I don't understand why Prosperent decodes the encoded params - I would think they are supposed to remain encoded when they pass it along, but that is not something I guess I need to understand.

    I don't get that you have said the 'merchant' -- ie Scorebig converts the %2B to a + . as I'm not sure how you know what Scorebig is doing with the %2B. That's where I'm probably being stupid, so I'll apologize up front OTOH, I'm not sure that is relevant,

    Since the issue has to do with how Prosperent converts the %2B then it isn't related to whether I'm passingthe link to Prosperent as a hyperlink or as a header url, as long as I pass to Prosperent what they expect in the urls/params. That is a big issue on my end though because apparently the header command is treated differently (by browsers?) than a straight hyperlink.
    Last edited by tedm; 05-14-2015 at 11:13 AM.

  3. #13
    Quote Originally Posted by tedm View Post
    I don't understand why Prosperent decodes the encoded params - I would think they are supposed to remain encoded when they pass it along, but that is not something I guess I need to understand.
    We are not decoding the merchant's params, we are decoding the url param that you have encoded. It this case, it is an unfortunate casualty. I'll let you know when I come up with something. However, I am working on a very high priority task, so this takes the back seat.

  4. #14
    Quote Originally Posted by tedm View Post
    Ok, here is my 'take' on the issues we seem to be discussing:

    I get that Prosperent is converting(ie decoding) the %2B to a + and that Scorebig is expecting a %2B - therefore it doesn't work.
    I don't get that the same thing doesn't happen to the %2F. In that case Prosperent converts it to a / but Scorebig apparently isn't expecting a %2F because the / works for them.

    I don't understand why Prosperent decodes the encoded params - I would think they are supposed to remain encoded when they pass it along, but that is not something I guess I need to understand.

    I don't get that you have said the 'merchant' -- ie Scorebig converts the %2B to a + . as I'm not sure how you know what Scorebig is doing with the %2B. That's where I'm probably being stupid, so I'll apologize up front OTOH, I'm not sure that is relevant,

    Since the issue has to do with how Prosperent converts the %2B then it isn't related to whether I'm passingthe link to Prosperent as a hyperlink or as a header url, as long as I pass to Prosperent what they expect in the urls/params. That is a big issue on my end though because apparently the header command is treated differently (by browsers?) than a straight hyperlink.
    Yea, that's why I said, there's no double-encode or double-decode when it comes to querystring parameters. You can't encode %2B again because it's already encoded. So when prosperent decodes the url= parameter, it decodes everything within that url parameter, including the already encoded %2B

    Try it yourself. Encode +, then Encode the result again. Then run decode once. And see what happens

  5. #15
    Yeah, I knew that you can't double encode. I can't say I understand why it is being decoded by Prosperent, despite Andrew's answer, since urls are supposed to be passed encoded. Maybe it has something to do with Commission Junction's requirements for the url? This is for Acid though as I understand Andrew has more important things, and it isn't something I need to understand. Just a curious guy.. Until a solution is found I'll send a different deep link.

    QUESTION: I just discovered that another merchant that I"m deeplinking for offers a coupon sometimes with a coupon code. Even though the url for that coupon is for page X, if I deep link instead to page Y and provide the coupon code, that code should still work, right?

  6. #16
    Not sure re: your last question, but if you allow the user to copy/paste (to clipboard) the coupon, and it's something they have to type in, I'm sure deep linking will still work. I've seen coupon sites rely on URL/cookie for coupons sometimes.

    As with your first question, I'll try and explain a bit clearer.

    Prosperent gets the "url" query string from you, which is encoded.

    (pseudo code on Prosperent side)
    Code:
    $url = $_GET["url"];
    //log stuff so we know Ted is credited for this
    http_redirect($url);
    The above code will end up sending the browser this: https%3A%2F%2Fwww.scorebig.com%2Fmost-popular%2Ford%3FCategory%3De%252Fshd%252B%26WhenSt artDate%3D%26WhenEndDate%3D

    Copy that into a new browser window and hit enter. Did it work? On my side, it tried searching on google for that. Because typing an url into the browser like that, won't work.

    Now, pseudo code on Prosperent side what currently is happening:
    Code:
    $url = url_decode($_GET["url"]);
    //log stuff so we know Ted is credited for this
    http_redirect($url);
    As soon as you url_decode, you get this: https://www.scorebig.com/most-popula...=&WhenEndDate=

    That's because the e%2Fshd%2B forms part of normal url encoding/decoding. So the merchant has a requirement within THEIR querystring for e%2Fshd%2B, but because Prosperent had to decode the url parameter: https%3A%2F%2Fwww.scorebig.com%2Fmost-popular%2Ford%3FCategory%3De%252Fshd%252B%26WhenSt artDate%3D%26WhenEndDate%3D it just so happens that the e%2Fshd%2B part got decoded too.

    So what you end up with is https://www.scorebig.com/most-popula...=&WhenEndDate=

    Hope I explained it properly

  7. #17
    I think so. From some testing today, GET by default decodes the url. So decoding by Prosperent should only be necessary if there has been a double encode (ie the params in the affiliate url were encoded and then the entire param for the affiliate link was encoded (ie "url=" . urlencode(affiliatelink)).

    SO, I have to go back to basics--how is an affiliate link supposed to be encoded for Prosperent?

    like this (double encode)? :

    $url = "https://www.scorebig.com/most-popular/stl?Category=" . urlencode("pqlgod") . "&WhenStartDate=" . urlencode("05/18/15") . "&WhenEndDate=" . urlencode("05/26/15");
    $tourl = "http://prosperent.com/api/linkaffiliator/redirect?apiKey=myapikey&url=" . urlencode($url);
    header('Location: ' . $tourl );


    or this (single encode)? :

    $url = "https://www.scorebig.com/most-popular/stl?Category=pqlgod&WhenStartDate=05/18/15&WhenEndDate=05/26/15";
    $tourl = "http://prosperent.com/api/linkaffiliator/redirect?apiKey=myapikey&url=" . urlencode($url);
    header('Location: ' . $tourl );

    Both of these work for this example, but I would think Prosperent prefers one over the other

    VERY RELEVANT: FOR PRODUCTS I've been encoding the entire affiliate url and not just the part after the ? It seems to be working but is that the right way?
    Also, I know this is a super dumb question but the product affiliate urls returned contain a code that identifies ME right? for example, it is found where bolded right?
    http://prosperent.com/store/product/is this my identifyer/?k=American+Apparel+Women%27s+Black+Opaque+Cable-Knit+Tights&m=124314&b=American+Apparel&p=ba4e7134 ac38482bb50e87813bf72346&
    Last edited by tedm; 05-19-2015 at 09:02 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
coupons | coupons and deals