---
title: Magento data feed guide
description: While Magento does provide a way to extract a product data feed from your shopping cart, it is essentially a snapshot of your database at the time you request it - there is no way to retrieve an up-to
---

[Skip to content](https://help.commissionfactory.com/magento-data-feed-guide#main-content)

English

Show submenu for translations

[![Horizontal Logo_Dark Blue](https://help.commissionfactory.com/hs-fs/hubfs/Commission-Factory/Images/NEW%20CF%20Logos/Horizontal%20Logo_Dark%20Blue.png?width=116&height=32&name=Horizontal%20Logo_Dark%20Blue.png)](https://www.commissionfactory.com/)

- [Affiliates](https://www.commissionfactory.com/affiliate-tour)
- [Advertisers](https://www.commissionfactory.com/advertiser-tour)
- [Agencies](https://www.commissionfactory.com/agency-tour)
- [Contact Us](https://www.commissionfactory.com/contact-us)
- [Blog](https://blog.commissionfactory.com/?_ga=2.240050887.53405967.1574634649-1513389297.1570501408)

Open main navigation

Close main navigation

- [Affiliates](https://www.commissionfactory.com/affiliate-tour)
- [Advertisers](https://www.commissionfactory.com/advertiser-tour)
- [Agencies](https://www.commissionfactory.com/agency-tour)
- [Contact Us](https://www.commissionfactory.com/contact-us)
- [Blog](https://blog.commissionfactory.com/?_ga=2.240050887.53405967.1574634649-1513389297.1570501408)
- English
  
  Show submenu for translations
- [www.commissionfactory.com](https://www.commissionfactory.com/)

[www.commissionfactory.com](https://www.commissionfactory.com/)

 Hello. How can we help you?

- There are no suggestions because the search field is empty.

1. [Commission Factory Help Centre](https://help.commissionfactory.com/?hsLang=en)
2. [Advertiser](https://help.commissionfactory.com/advertiser?hsLang=en)
3. [Technical Guides](https://help.commissionfactory.com/advertiser?hsLang=en#technical-guides)

# Magento data feed guide

While Magento does provide a way to extract a product data feed from your shopping cart, it is essentially a snapshot of your database at the time you request it - there is no way to retrieve an up-to-date data feed automatically at any given time.

In order to keep your product data feed up-to-date for affiliates, we have created a script that you can use to generate an up-to-date product data feed on Magento. You can then specify that you want your data feed updated on the Commission Factory network automatically every night.

Simply **download the attached PHP file**, **unzip it**, and then upload the **cf\_magento\_feed.php** file to the Magento root directory on your server.

Once this file has been uploaded, you will be able to access an up-to-date product data feed at any time from a URL (eg. "http://www.yourdomain.com/cf\_magento\_feed.php"). You can then enter this URL in the **Configure Feed** page of your dashboard to enable automatic nightly updates.

 [Download the Magento Data Feed script (.php file 4KB)](https://c.cfjump.com/SupportWiki/Files/cf_magento_feed_php.zip)

```
<?php    header("Content-Disposition: attachment; filename=cf_magento_feed.csv");    header("Content-Type: text/csv");    require_once($_SERVER["DOCUMENT_ROOT"] . "/app/Mage.php");    Mage::app();    $baseUrl = Mage::app()->getStore(Mage::app()->getStore()->getStoreId())->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);    $baseMediaUrl = Mage::getSingleton("catalog/product_media_config")->getBaseMediaUrl();    $products = Mage::getModel("catalog/product")->getCollection();    $products->addAttributeToFilter("status", 1);    $products->addAttributeToFilter("visibility", array(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH, Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG));    $products->addAttributeToSelect("sku");    print("SKU,Name,Category,Description,Url,Image,Price,Brand,Colour,PriceSale\r\n");    foreach($products->getAllIds() as $productId)    {        $product = Mage::getModel("catalog/product")->load($productId);        $product_data = array();        $product_data["SKU"] = $product->getSku();        $product_data["Name"] = $product->getName();        $product_data["Category"] = "";        $product_data["Description"] = trim(ereg_replace("^[ \t\r\n]+|[ \t\r\n]+", " ", strip_tags($product->getShortDescription())));        $product_data["Url"] = $baseUrl . $product->getUrlKey() . Mage::getStoreConfig("catalog/seo/product_url_suffix");        $product_data["Image"] = $baseMediaUrl . $product->getImage();        $product_data["Price"] = $product->getFinalPrice();        $product_data["Brand"] = $product->getAttributeText("manufacturer");        $product_data["Colour"] = $product->getAttributeText("color");        $product_data["PriceSale"] = $product->getAttributeText("special_price");        foreach ($product->getCategoryIds() as $categoryId)            $product_data["Category"] .= Mage::getModel("catalog/category")->load($categoryId)->getName() . ", ";        $product_data["Category"] = rtrim($product_data["Category"], ", ");               foreach ($product_data as $k => $val)        {            $bad = array("\"", "\r\n", "\r");            $good = array("\"\"", "\n", " ");            $product_data[$k] = "\"" . str_replace($bad, $good, $val) . "\"";        }        $feed_line = implode(",", $product_data) . "\r\n";        print($feed_line);    }?>
```

 

- [Affiliate](https://help.commissionfactory.com/affiliate?hsLang=en#main-content)
  
  
  
  
  
    - [Account Set Up](https://help.commissionfactory.com/affiliate?hsLang=en#account-set-up)
    - [Billing and Payments](https://help.commissionfactory.com/affiliate?hsLang=en#billing-and-payments)
    - [Compliance](https://help.commissionfactory.com/affiliate?hsLang=en#compliance)
    - [Partnership Types and Strategies](https://help.commissionfactory.com/affiliate?hsLang=en#partnership-types-and-strategies)
    - [Platform and Tools](https://help.commissionfactory.com/affiliate?hsLang=en#platform-and-tools)
    - [Technical Guides](https://help.commissionfactory.com/affiliate?hsLang=en#technical-guides)
- [Advertiser](https://help.commissionfactory.com/advertiser?hsLang=en#main-content)
  
  
  
  
  
    - [Getting Started Videos](https://help.commissionfactory.com/advertiser?hsLang=en#getting-started-videos)
    - [Billing and payments](https://help.commissionfactory.com/advertiser?hsLang=en#billing-and-payments)
    - [Compliance](https://help.commissionfactory.com/advertiser?hsLang=en#compliance)
    - [Partnership Types and Strategies](https://help.commissionfactory.com/advertiser?hsLang=en#partnership-types-and-strategies)
    - [Platform and Tools](https://help.commissionfactory.com/advertiser?hsLang=en#platform-and-tools)
    - [Technical Guides](https://help.commissionfactory.com/advertiser?hsLang=en#technical-guides)
- [Glossary](https://help.commissionfactory.com/glossary?hsLang=en)
- [All customers](https://help.commissionfactory.com/all-customers?hsLang=en)

[![Commission Factory](https://help.commissionfactory.com/hs-fs/hubfs/CF_Cog_2025.png?width=50&height=50&name=CF_Cog_2025.png "Commission Factory")](https://help.commissionfactory.com/?hsLang=en)

Commission Factory Help Centre

Copyright © 2026, Commission Factory Pty Ltd