dub icon indicating copy to clipboard operation
dub copied to clipboard

Programmatic Affiliate Links (e.g. Tracked Cloudflare Page Rules)

Open abass opened this issue 1 year ago • 4 comments

We are using a simple rewrite for ad-hoc/programmatic Affiliate Links for products on Amazon.

The example is, we have a subdomain (a.efficient.link/*) which simply redirects to amazon.com/$1?tag=efficientapp-20

AKA we can, on-the-fly spin up an affiliate link for an Amazon product by simply having the product URL code at in-place of the *.

So the $1 in the resulting URL would just be that ID, and that way we have a clean short link that appends our Amazon Affiliate to any a. Short Link.

Alas, this is a simple Page Rule within Cloudflare, although we have no tracking anywhere for it now, which is a bummer. It would be cool to have analytics spun up new URL's are visited via that paradigm, almost like a link alias but not because each is a different link, it's just more on the fly.

Wouldn't need to be anything major, just would want to know how many total clicks and click stats went to a.efficient.link and ideally be able to see click stats for each visited /$1 but also as a first step not critical to have the more granular reporting. Just replacing Cloudflare would be a win.

abass avatar Jan 04 '24 12:01 abass

Love this idea – seems related to #529 😄 planning to get this prioritized soon! 🙏

Question: would it be okay to make this work on a per-domain basis? e.g. you can set up a redirect rule for a.efficient.link/*, but you can't do it for efficient.link/r/*? Or would you prefer to have it work for both?

steven-tey avatar Jan 04 '24 20:01 steven-tey

Ah! Yes, very much related!

And so while on a domain level is okay to start, we want to set up some redirects for the latter, and have already, but it requires Cloudflare Page Rules and didn't allow us to fully embrace Dub in those instances.

Example: We have been using efficient.tips/yt/* for YouTube videos but decided we don't want to anymore (got a better domain), so we want the above to now be: efficient.yt/$1 (only for /yt/* but we want to keep efficient.tips/b/ and other efficient.tips to be an optional short link in Dub to use.

So the long and short of it is, we need both, or we need to keep using Cloudflare, but then we lose Dub stats and get an error in Dub saying it's not fully connected, so just torn overall. Ideally it worked for both and we can fully ditch Cloudflare AND get stats, which would be AMAZING.

abass avatar Jan 04 '24 21:01 abass

thanks for explaining @abass! this makes a lot of sense – this is actually a highly requested feature so we will get this prioritized soon!

steven-tey avatar Jan 05 '24 01:01 steven-tey

Awe, so we need to keep using Cloudflare then? 🥲

abass avatar Jul 08 '24 06:07 abass