1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

CJ Product Feed - Parsing HowTo

Discussion in 'Commission Junction' started by hanji, Jun 2, 2009.

  1. #1
    Hello

    Since CJ now allows you to create and manage product feeds, and since I had a few people email on how to parse this, I wrote a quick little how to. This will take a XML product feed and parse it via simplexml_load_file() function. This will only be useful for people using PHP5.

    Parsing XML CJ Product Feeds

    Anyway, hope it helps someone.
    hanji
     
    hanji, Jun 2, 2009 IP
  2. LegalClipper

    LegalClipper Peon

    Messages:
    180
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    That's pretty cool...!

    Do you do programming on a freelance basis- I'm looking for something very similar for Wordpress...Script that automatically updates the feed & then posts blog posts at random intervals using custom templates?

    PM me...
     
    LegalClipper, Jun 6, 2009 IP
  3. mxyzplk

    mxyzplk Well-Known Member

    Messages:
    792
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    140
    #3
    I still confuse how to use it, should this 1111111_11111_20090528.xml replaced by something?
     
    mxyzplk, Jun 7, 2009 IP
  4. hanji

    hanji Peon

    Messages:
    612
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #4
    That's an example file name of the XML product feed/catalog that you would be getting from CJ.

    hanji
     
    hanji, Jun 7, 2009 IP
  5. charter

    charter Guest

    Messages:
    806
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I would also love to find something like this for WP
     
    charter, Jun 7, 2009 IP
  6. mxyzplk

    mxyzplk Well-Known Member

    Messages:
    792
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    140
    #6
    Ok I already fix that problem, the next thing is... how can I deliver the product feed directly to my hosting? I confuse how to set the ftp server.
     
    mxyzplk, Jun 7, 2009 IP
  7. hanji

    hanji Peon

    Messages:
    612
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I'll write up a howto on using PHP's FTP functions to bring the XML file to your hosting account. This might be dependent on your PHP configuration though.

    hanji
     
    hanji, Jun 7, 2009 IP
  8. hanji

    hanji Peon

    Messages:
    612
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #8
    hanji, Jun 7, 2009 IP
    mxyzplk likes this.
  9. mxyzplk

    mxyzplk Well-Known Member

    Messages:
    792
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    140
    #9
    mxyzplk, Jun 7, 2009 IP
  10. swapnilp

    swapnilp Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Hanji, thanks for the helpful post.

    I'm a PHP programmer and newbie to CJ. We are developing a website which would integrate CJ, fetch all the categories and merchant data from CJ. We are able to program it. Now we also need to get the transaction data on sales, commission etc from CJ, but as we've opened new account, there is no transaction data in it. So can you please suggest how should we go ahead with it and if there is any way to implement this functionality.

    Thanks,
    Swapnil.
     
    swapnilp, Jun 16, 2009 IP
  11. markowe

    markowe Well-Known Member

    Messages:
    1,136
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    165
    #11

    Nice easy routine. Just wondered though - I am not really clued up on what the advantage is of using those CJ product feeds. Isn't directly accessing the API more flexible? That's what I did, using some SOAP code (REST not supported by CJ still, I believe) that is available on the CJ dev site - that way you can search the entire product catalogue on lots of criteria any time you want, without having to generate those XML files.
     
    markowe, Jun 18, 2009 IP
  12. swapnilp

    swapnilp Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Markowe, thats the same way we fetched the category and merchants information from CJ. Do you have any experience in how to get transaction data from CJ like commission, sales etc using PHP?

    Thanks in Advance!!

    Swapnil.
     
    swapnilp, Jun 19, 2009 IP
  13. markowe

    markowe Well-Known Member

    Messages:
    1,136
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    165
    #13
    Hi, no, afraid not, I never tried - I didn't really look into it actually. I don't earn enough through CJ to make that worth bothering :/.
     
    markowe, Jun 19, 2009 IP
  14. hanji

    hanji Peon

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

    I would agree that API in some ways are more flexible. Originally, when I started working with CJ I worked with the CJ API, but was extremely disappointed on performance and reliability. I would get Java errors returned from API call, and on occasion the requests were extremely slow. That's when I started to look for other options and went with the datafeed.

    With the datafeed, you can increase performance since you'd be querying a local database. Since we're talking raw data, I didn't have to worry about getting oddball SOAP errors from their web service, etc.

    But, I would also like to say that with my examples, I'm querying a certain subset of data, and the limited information I can retrieve with datafeeds is more than adequate for me. If you need additional information about the advertiser or transactions, etc as others have commented on, then you're only option is to go with the API for that level of information.

    My goals for my store fronts and CJ, is reliability, speed and ease. That's why I went with datafeeds vs. API.

    Great question.

    Thanks!
    hanji
     
    hanji, Jun 22, 2009 IP
  15. markowe

    markowe Well-Known Member

    Messages:
    1,136
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    165
    #15
    Thanks for the answer - that makes sense!
     
    markowe, Jun 22, 2009 IP