views:

275

answers:

1

DetailPageURL's returned by ItemSearch seem to include an incorrect ID/tag rather than the associate ID I requested the search with.

I'm getting:

http://www.amazon.co.uk/gp/product/1590595009?SubscriptionId=XXX&tag=foo-12&linkCode=as2&camp=1634&creative=19450&creativeASIN=1590595009

When I expect:

http://www.amazon.co.uk/gp/product/1590595009?SubscriptionId=XXX&tag=wwwmydomain-12&linkCode=as2&camp=1634&creative=19450&creativeASIN=1590595009

How do I get the correct tag? (Note that SO rewrites the above links to their own Associate ID if you click either of the above)

I'm using Python and PyAWS 0.3.0, although I think the problem is with my request, rather than with the API wrapper.

(As an aside, The Amazon Associates Link Checker (U.K. store) is invaluable in testing these links)

+1  A: 

Simple error in the end..... I was including the tag in the initial search:

for searchResult in ecs.ItemSearch(item, SearchIndex=index, AssociateTag='wwwmydomain-12')

But not in the secondary loop that steps through each result getting more details:

for item in ecs.ItemSearch(searchResult.ASIN, ResponseGroup='Medium'):

should be:

for item in ecs.ItemSearch(searchResult.ASIN, ResponseGroup='Medium', AssociateTag='wwwodbodycom-21'):

The tag is needed in both - it seems it's not carried over.

Jon Hadley