An excellent way for an advertiser to share thousands of products with partners, comparison shopping sites, and marketplaces is to provide them with a partner data feed. This feed is a file containing specific information about their products and where to find them on their website.
Although most e-commerce solutions provide access to an XML data feed, they are not integrated with their partner tracking software. Thus, advertisers can’t share them with their partners. This article outlines the benefits of data feeds for partners. Providing data feeds to partners is the only way to help partners promote the right products on the fly.
XML Feeds
A data feed is an XML file containing details on the advertiser’s products. Each product is a new record in the file and includes the product name, description, URL, image links, categories, and prices. The information in a data feed may vary from advertiser to advertiser as there is no standard way of creating them. Having the feed of data return in an XML format provides a universal, easy-to-parse solution for partners to pull the data from the advertiser, display them on their sites, and append partner tracking links to the product pages provided in the feed.
For example, if a partner has several websites that review clothing and decides to promote different clothes from Nordstrom, instead of loading an offer for each piece of clothing, Nordstrom would create one offer with a partner data feed in XML format. This way, the partner doesn’t have to hunt through thousands of offers. Instead, they pull the XML feed and use their code to show the right products to users. The links for the products in the XML feed would include the partner’s tracking code so that the partner would get credit for any sales generated and paid accordingly.
Setting up an XML feed for partners saves the advertiser a massive amount of time by linking to all the included products in their store and containing all the products in one offer instead of potentially thousands of different offers.
XML feeds come in a simple URL that contains all the XML data, similar to the one below:
http://myadvertiserstore.com/product-feed
When you visit this URL, you can view the feed XML in your browser. Here is an example of what the feed data can look like:
<?xml version="1.0"?> <Products> <Product> <Name>Soft Duvet Set</Name> <Description>Seriously soft, gets softer with each wash. Made of 100% cotton. Signature 2" flange.</Description> <Price>$139.00</Price> <URL>http://thebeddingstore.com/product/392487-Soft-Duvet-Set</URL> </Product> <Product> <Name>Stripe Sheet Set</Name> <Description>The single pick construction and washing process produces a fabric that gets softer with each wash. Features embroidered stripes</Description> <Price>$95.00</Price> <URL>http://thebeddingstore.com/product/987234-Stripe-Sheet-Set</URL> </Product> <Product> <Name>Linen Decorative Pillow</Name> <Description>100% linen square pillow. Polyester fill insert included.</Description> <Price>$35.00</Price> <URL>http://thebeddingstore.com/product/725284-Linen-Decorative-Pillow</URL> </Product> </Products>
Adding an XML Feed Creative
Before you start adding the XML feed to your TUNE account, you need to enable Deep Links in the offer. This will allow the tracking link to append a custom URL to which it sends the traffic. Because each product has a different URL, this feature MUST be enabled for the XML feed to work.
Once you have enabled deep links for the offer, go to Offers > Creative Files and click Add Creative. Select the offer(s) that you want to add this feed to, and give the XML feed a name. Select the “XML Feed” option from the creative types. You can also make the feed private so partners can’t grab the URL in their interface.
The XML feed aims to find the product URLs in the XML file and swap them out for your platform's partner tracking links that redirect to the product page. To accomplish this, the feed parses through the XML tags and looks for a place where the URL tag holds the product page URL. By default, the parser looks for an XML file structured like Products > Product > URL.
It looks like the root tag is named “Products,” where all the products are nested inside. Then it looks for the next child tag: “Product,” which contains all the tags that attribute a specific product. Inside this tag should be a “URL” tag that contains the URL of the product. This value is swapped out with a partner tracking link, appending the original URL at the end.
If your XML feed is structured like this, you can generate an XML feed URL on the offer page by selecting it from the creative dropdown in the generate tracking section. You will end up with a hosted URL like this:
http://demo.go2feeds.org/feed.php?aff_id=1&offer_id=1&file_id=2034&feed=aHR0cHM6Ly9zaG9wLmxpZ25lLXJvc2V0LmNvLnVrL2ZlZWQv
When you open the URL, the URL tag will have the updated links:
<?xml version="1.0"?> <Products> <Product> <Name>Soft Duvet Set</Name> <Description>Seriously soft, gets softer with each wash. Made of 100% cotton. Signature 2" flange.</Description> <Price>$139.00</Price> <URL>http://demo.go2cloud.org/aff_c?aff_id=1&offer_id=1&url=http%3A%2F%2Fthebeddingstore.com%2Fproduct%2F392487-Soft-Duvet-Set</URL> </Product> <Product> <Name>Stripe Sheet Set</Name> <Description>The single pick construction and washing process produces a fabric that gets softer with each wash. Features embroidered stripes</Description> <Price>$95.00</Price> <URL>http://demo.go2cloud.org/aff_c?aff_id=1&offer_id=1&url=http%3A%2F%2Fthebeddingstore.com%2Fproduct%2F987234-Stripe-Sheet-Set</URL> </Product> <Product> <Name>Linen Decorative Pillow</Name> <Description>100% linen square pillow. Polyester fill insert included.</Description> <Price>$35.00</Price> <URL>http://demo.go2cloud.org/aff_c?aff_id=1&offer_id=1&url=http%3A%2F%2Fthebeddingstore.com%2Fproduct%2F725284-Linen-Decorative-Pillow</URL> </Product> </Products>
With the example above, the TUNE XML feed tool looks for the Products > Product > URL structure of an XML file to find the product page URL, but in many instances, this is not how the advertiser sets up the tag structure. Perhaps the URL tags are named differently, or all the tags have different names. In either situation, you can specify what tags to look out for so the tool knows where to look in the XML tag hierarchy. Let’s say, for example, just the URL tag is named “ProductURL,” as you see here:
<?xml version="1.0"?> <Products> <Product> <Name>Soft Duvet Set</Name> <Description>Seriously soft, gets softer with each wash. Made of 100% cotton. Signature 2" flange.</Description> <Price>$139.00</Price> <ProductURL>http://thebeddingstore.com/product/392487-Soft-Duvet-Set</URL> </Product> </Products>
In this case, we can tell the tool to find that tag by specifying its replacement. When setting up the XML feed creative, add the parameter to the end of the original URL:
http://myadvertiserstore.com/product-feed?url_tag=ProductURL
This looks for the “Products” root tag, then the child tag “Product,” and since we specified that the URL tag is named “ProductURL,” the tool knows to replace the URL inside that tag with the partner’s tracking link. The “url_tag” parameter is the one that points to the tag with the product page URL.
If the tag structure has more than one different name for the tags, you just have to use additional parameters to specify which tags match the normal naming convention. For example, let’s look at an XML file that has a similar structure to the standard but differently named tags:
<?xml version="1.0"?> <Store> <Item> <Name>Soft Duvet Set</Name> <Description>Seriously soft, gets softer with each wash. Made of 100% cotton. Signature 2" flange.</Description> <Price>$139.00</Price> <ItemURL>http://thebeddingstore.com/product/392487-Soft-Duvet-Set</URL> </Item> </Store>
In the example above, the URL is hosted in a tag called “ItemURL,” which is nested in “Item” and “Store” as the root tag. The tool does not recognize this structure because it doesn’t follow the standard Products > Product > URL naming convention. We have to start at the top level and drill down to the URL tag. Here is how that would look:
http://myadvertiserstore.com/product-feed?objects=Store&object=Item&url_tag=ItemURL
With the parameters added, we are telling the tool that the “Products” parent tag is now named “Store,” and inside that is the “Product” tag, now named “Item.” Inside the Item tag is the URL tag named “ItemURL,” and that will have the product page URL.
Adding an Additional Root Tag
There are instances where the root tag goes one level higher than an equivalent “Products” tag, like in this example:
<?xml version="1.0"?> <Store> <Products> <Product> <Name>Soft Duvet Set</Name> <Description>Seriously soft, gets softer with each wash. Made of 100% cotton. Signature 2" flange.</Description> <Price>$139.00</Price> <URL>http://thebeddingstore.com/product/392487-Soft-Duvet-Set</URL> </Product> </Products> </Store>
Here, the “Store” tag is the root tag in the file, where the tool is looking for the “Products” tag. However, the “Products” tag is nested inside the “Store” tag. In this case, append the “parent” parameter in the original URL:
http://myadvertiserstore.com/product-feed?parent=Store
This tells the tool to start one level up at the “Store” tag and drill down from there.
Now, if you have a higher level tag and custom naming for all tags in the file, you can append them as well:
http://myadvertiserstore.com/product-feed?parent=Store&objects=Items&object=Item&url_tag=ItemURL
Passing Parameters Into the Product URL
For offers that use postback tracking or want to pass through certain parameters into the product page URLs, you can do so by appending those values onto the original feed URL when you save it as a Creative File. To do this, encode the query string you want to append to the landing page URLs by using a URL encode tool such as the one located at meyerweb.com/eric/tools/dencoder/. Then, place it inside the “url_query” parameter of the original feed URL.
Example: We want to add to parameters, “sub_id,” “click_id”, and “utm_source”:
sub_id={aff_sub}&click_id={transaction_id}&utm_source=hasoffers
We run that through the encoding tool and get the following:
sub_id%3D%7Baff_sub%7D%26click_id%3D%7Btransaction_id%7D%26utm_source%3Dhasoffers
We make this the value of a “url_query” parameter:
&url_query=sub_id%3D%7Baff_sub%7D%26click_id%3D%7Btransaction_id%7D%26utm_source%3Dhasoffers
Finally, we add that parameter to the feed URL provided by our advertiser:
http://myadvertiserstore.com/product-feed?i=dfsdfsdte44c7607d5ca928b&url_query=sub_id%3D%7Baff_sub%7D%26click_id%3D%7Btransaction_id%7D%26utm_source%3Dhasoffers
When these are added to the original feed URL in the Creative File, the ad server passes them through to each URL in the XML feed. All optional macros in a default offer URL can be passed to the product URL.
Example PHP Code for Partner
Once you have the partner data feed attached to an offer, partners can start consuming it. Here is a simple PHP example. It displays all the records where the page is 1 and uses Memcache to save the result temporarily for increased performance.
$memcache_obj = new Memcache; $memcache_obj->connect('127.0.0.1', 11211); $url = "http://demo.go2feeds.org/feed.php?aff_id=1&offer_id=5&file_id=1035&feed=aHR0cDovL2ZlZWRzLm9tZ2V1LmNvbS9kYXRhL2ZlZWQuYXNweA&hash=6dd9f2a3f0854495ba1a2d25c1dd858b&page=1"; $xmlFile = $memcache_obj->get($cache_key); if ($xmlFile === false || $debug ) { $xmlFile = file_get_contents($url); if(!empty($xmlFile)) $memcache_obj->set($cache_key, $xmlFile, MEMCACHE_COMPRESSED, 3600*1); } $xml = new SimpleXMLElement($xmlFile); foreach($xml->Products->Product as $product) { echo "<div>"; echo "<h3><a href="".$product->URL."">".$product->Name."</a></h3>"; echo "<p><img src="".$product->SmallImage."" align="left"/> ".$product->Description."</p>"; echo "<p>".$product->Price."</p>"; echo "</div>"; }