最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

deep linking - In Android, deeplink from Chrome browser to Amazon app. Intent, package, scheme? - Stack Overflow

matteradmin8PV0评论

I have a website and am adding Amazon affiliate linking. Currently, my affiliate links open in the Amazon website, but I want them to open in the Amazon app.

I'm wondering if Amazon has an intent/scheme solution similar to how I am able to open my own (unrelated) app from a browser using the below format:

<a href="intent://MYAPP_URLPATH/#Intent;scheme=MYAPP_SCHEME;package=MYAPP_PACKAGE;end">open page in app</a>

Or maybe another way? Some people use a service like joturl or URLgenius, which creates the deeplinks, but it seems that if they can do it, then so can I? Or do these services have some kind of deal with Amazon?

Note, I'm not trying to open Amazon from an app, but from a browser, such as Chrome. This is in Android.

I have a website and am adding Amazon affiliate linking. Currently, my affiliate links open in the Amazon website, but I want them to open in the Amazon app.

I'm wondering if Amazon has an intent/scheme solution similar to how I am able to open my own (unrelated) app from a browser using the below format:

<a href="intent://MYAPP_URLPATH/#Intent;scheme=MYAPP_SCHEME;package=MYAPP_PACKAGE;end">open page in app</a>

Or maybe another way? Some people use a service like joturl or URLgenius, which creates the deeplinks, but it seems that if they can do it, then so can I? Or do these services have some kind of deal with Amazon?

Note, I'm not trying to open Amazon from an app, but from a browser, such as Chrome. This is in Android.

Share Improve this question edited Nov 16, 2024 at 21:06 user984003 asked Nov 16, 2024 at 18:53 user984003user984003 29.6k69 gold badges202 silver badges315 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Got it. Works in iOS and Android.

Note that this doesn't redirect if the user doesn't have the app installed. Then it fails silently.

I tested it and it does seem that the affiliate tag gets passed correctly and register as a link.

Grab the product page's full affiliate link. Then replace

https://www.amazon/

with

com.amazon.mobile.shopping.web://amazon/

So you get an URL like this, of course with your tag and the correct linkId:

com.amazon.mobile.shopping.web://amazon/LEGO-Valentines-Flower/dp/B0CDCL6Y5T?th=1&linkCode=ll1&tag=YOUR_TAG&linkId=THE_LINK_ID&language=en_US&ref_=as_li_ss_tl

You can use that in html:

<a href = "the_url">buy</a>

or javascript:

location.href = the_url

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far