I was wondering, linkshare and commission junction use a hidden image to track the impressions that text links receive. They have told me that I cannot simply use the link, that I must have the hidden image link in order to get paid properly. For PT I am creating a excel spreadsheet for my products. What is the best way to handle this? Here is an example of what they want to see in their text buy links:
<a href="http://www.anrdoesfe.net/click-234340028-103334343" target="_top">Samsung 42 Inch. LCD TV LC452323A</a>
<img src="http://www.lduhtads.net/image-22343028-10323232" width="1" height="1" border="0"/>
Thank you very much! So in my spreadsheets, would I set it up like this?:
Merchant: Frys.com
Product: Samsung 42 Inch. LCD Tv LC452323A
Description: The Samsung LCD tv....
Keywords:samsung lcd tv
Image: http://www.samsumg.com/images/lcd23.jpg
Affiliate Buy URL: http://www.anrdoesfe.net/click-234340028-103334343
Impression: http://www.lduhtads.net/image-22343028-10323232.jpg (do I neeed to enter this as img src="" or just the image link?)
Price: 829.00
Hi,
Right, you can do it either way. Based on the code in my post above, the field "Impression" would need to contain the full HTML for the image, i.e. <img src='http://....' />
However, if it would be easier for your feed construction to just contain the impression URL on its own (which I think is a neater aproach), then in the code modifications above, instead of, for example:
print $product["impression"];
...you would use:
print "<img src='".$product["impression"]."' />";
(remember to make sure you use the correct variable - $product, $mainProduct or $priceProduct as appropriate).
Cheers,
David.
Dave,
I made the changes you indicated to add a new field. Now when I register a feed I get the ability to map the impression field, however when I try to click register and trial/full import nothing happens and it kicks me back to start all over again.
In the sample field data everything shows up correctly, however the Impression field data has extra quotes " that I dont have in the actual feed. It shows up in the sample like:
"<IMG border=0 width=1 height=1 src=""http://ad.linksynergy.com/f...
however in my feed i have it listed as
<IMG border=0 width=1 height=1 src="http://ad.linksynergy.com/f..." >
Here are the changes I made to the code:
In the includes/admin.php file:
function admin_register($filename,$format,$merchant,$fieldName,$fieldDescription,$fieldImageURL,$fieldBuyURL,$fieldPrice,$fieldCategory,$userCategory,$fieldBrand,$userBrand,$fieldImpression)
$sql = sprintf("INSERT INTO `".$config_databaseTablePrefix."feeds` SET
filename='%s',
registered='%s',
format='%s',
merchant='%s',
field_name='%s',
field_description='%s',
field_image_url='%s',
field_buy_url='%s',
field_price='%s',
field_category='%s',
user_category='%s',
field_brand='%s',
user_brand='%s'
field_impression='%s'
",
database_safe($filename),
time(),
database_safe($format),
database_safe(tapestry_normalise(ucwords($merchant),'\.')),
database_safe($fieldName),
database_safe($fieldDescription),
database_safe($fieldImageURL),
database_safe($fieldBuyURL),
database_safe($fieldPrice),
database_safe($fieldCategory),
database_safe(tapestry_normalise($userCategory)),
database_safe($fieldBrand),
database_safe(tapestry_normalise($userBrand)),
database_safe($fieldImpression)
);
$sql = sprintf("INSERT INTO `".$config_databaseTablePrefix."products` SET
merchant='%s',
name='%s',
description='%s',
image_url='%s',
buy_url='%s',
price='%s',
search_name='%s',
category='%s',
brand='%s',
dupe_hash='%s'
impression='%s'
",
database_safe($admin_importFeed["merchant"]),
database_safe($record[$admin_importFeed["field_name"]]),
database_safe(isset($record[$admin_importFeed["field_description"]])?$record[$admin_importFeed["field_description"]]:""),
database_safe(isset($record[$admin_importFeed["field_image_url"]])?$record[$admin_importFeed["field_image_url"]]:""),
database_safe($record[$admin_importFeed["field_buy_url"]]),
database_safe($record[$admin_importFeed["field_price"]]),
database_safe($searchName),
database_safe($category),
database_safe($brand),
$dupe_hash,
database_safe($impression)
);
in the html/product.php file
<h3><?php print $mainProduct["impression"] ?><a href='<?php print tapestry_buyURL($mainProduct); ?>' <?php print javascript_statusBar(translate("go to")." ".$mainProduct["merchant"]); ?>><?php print $mainProduct["name"]; ?></a></h3> <?php if ($mainProduct["description"]): ?>
<?php print $priceProduct["impression"] ?><a href='<?php print tapestry_buyURL($priceProduct); ?>' <?php print javascript_statusBar(translate("go to")." ".$priceProduct["merchant"]); ?>><strong><?php print $priceProduct["merchant"]; ?></strong></a><br /> <?php else: ?>
and in the prices.php file:
<td align='center'><?php print $product["impression"]; ?><a href='<?php print tapestry_buyURL($product); ?>' <?php print javascript_statusBar("go to ".$product["merchant"]); ?>><?php print translate("Visit Store"); ?></a></td> </tr>
Also forgot to include the code from feeds_register_step2.php:
Line 63:
admin_register($filename,$format,$_POST["merchant"],$_POST["fieldName"], (isset($_POST["fieldDescription"])?$_POST["fieldDescription"]:"") , (isset($_POST["fieldImageURL"])?$_POST["fieldImageURL"]:"") ,$_POST["fieldBuyURL"],$_POST["fieldPrice"],$_POST["fieldCategory"],$_POST["userCategory"],$_POST["fieldBrand"],$_POST["userBrand"],$_POST["fieldImpression"]);
under line 163:
field("Impression","fieldImpression");
Hi,
There is a comma missing in the modification to the SQL to insert the product, so
this would certainly result in no products being imported...
$sql = sprintf("INSERT INTO `".$config_databaseTablePrefix."products` SET
merchant='%s',
name='%s',
description='%s',
image_url='%s',
buy_url='%s',
price='%s',
search_name='%s',
category='%s',
brand='%s',
dupe_hash='%s',
impression='%s'
",
database_safe($admin_importFeed["merchant"]),
database_safe($record[$admin_importFeed["field_name"]]),
database_safe(isset($record[$admin_importFeed["field_description"]])?$record[$admin_importFeed["field_description"]]:""),
database_safe(isset($record[$admin_importFeed["field_image_url"]])?$record[$admin_importFeed["field_image_url"]]:""),
database_safe($record[$admin_importFeed["field_buy_url"]]),
database_safe($record[$admin_importFeed["field_price"]]),
database_safe($searchName),
database_safe($category),
database_safe($brand),
$dupe_hash,
database_safe($record[$admin_importFeed["field_impression"]])
);
(the comma was missing after dupe_hash='%s'
)
I'm not sure where the extra quotes are coming from in the sample data. Perhaps if
it's still not working properly after the above correction, if you could email me
your modified files together with the name of the feed and a link to your site, and
i'll download the feed from your /feeds/ folder to my test server and take a look
for you...
Cheers,
David.
David,
I tried adding the comma in the missing places, however it still does the same thing. Another strange thing is that it does not show the product description text that follows it, so perhaps somethign with the impression code is causing the hangup. I went ahead and emailed you my modded files and a sample feed file. Thanks again.
I'll be curious to see what this issue is also since I'd like to include this modification. I have the same feed companies so I guess I should include the impression info as well.
Thanks! -Joe
Hi Joe,
There was an additional modification required to the code above...
database_safe($impression)
...should have been:
database_safe($record[$admin_importFeed["field_impression"]])
(this has been corrected in the code above) - otherwise I believe it is working fine now...
Cheers,
David.
Hi,
Thinking about this, the best way would be to have the impression code imported as a new field, so that I can be shown alongside any link where it is required. I originally thought of just appending the impression HTML to the description field, but this would not work on a product page where the link that requires the impression HTML is not the cheapest product, but only appears in the price comparison table.
To add a new field, follow the instructions in this thread:
http://www.pricetapestry.com/node/313
...and I would recommend creating a field called "impression".
Then, the impression HTML can be registered (if required) along with the normal fields - Product Name, Description etc. Then, the field just needs to be output alongside every place where a Buy URL is generated. To do this, in html/product.php look for the following code on line 11:
<h3><a href='<?php print tapestry_buyURL($mainProduct); ?>' <?php print javascript_statusBar(translate("go to")." ".$mainProduct["merchant"]); ?>><?php print $mainProduct["name"]; ?></a></h3>
...and REPLACE this with:
<h3><?php print $mainProduct["impression"] ?><a href='<?php print tapestry_buyURL($mainProduct); ?>' <?php print javascript_statusBar(translate("go to")." ".$mainProduct["merchant"]); ?>><?php print $mainProduct["name"]; ?></a></h3>
...and line 28:
<a href='<?php print tapestry_buyURL($priceProduct); ?>' <?php print javascript_statusBar(translate("go to")." ".$priceProduct["merchant"]); ?>><strong><?php print $priceProduct["merchant"]; ?></strong></a><br />
...REPLACE this with:
<?php print $priceProduct["impression"] ?><a href='<?php print tapestry_buyURL($priceProduct); ?>' <?php print javascript_statusBar(translate("go to")." ".$priceProduct["merchant"]); ?>><strong><?php print $priceProduct["merchant"]; ?></strong></a><br />
...and finally in html/prices.php, line 14:
<td align='center'><a href='<?php print tapestry_buyURL($product); ?>' <?php print javascript_statusBar("go to ".$product["merchant"]); ?>><?php print translate("Visit Store"); ?></a></td>
...REPLACE this with:
<td align='center'><?php print $product["impression"]; ?><a href='<?php print tapestry_buyURL($product); ?>' <?php print javascript_statusBar("go to ".$product["merchant"]); ?>><?php print translate("Visit Store"); ?></a></td>
Hope this helps!
Cheers,
David.