Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 115467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:01:28+00:00 2026-05-11T03:01:28+00:00

Important: This question isn’t actually really an ASP.NET question. Anyone who knows anything about

  • 0

Important: This question isn’t actually really an ASP.NET question. Anyone who knows anything about URLS can answer it. I just happen to be using ASP.NET routing so included that detail.

In a nutshell my question is :

‘What URL format should I design that i can give to external parties to get to a specific place on my site that will be future proof. [I’m new to creating these ‘REST’ URLs].’


I need an ASP.NET routing URL that will be given to a third party for tracking marketing campaigns. It is essentially a ‘gateway’ URL that redirects the user to a specific page on our site which may be the homepage, a special contest or a particular product.

In addition to trying to capture the referrer I will need to receive a partnerId, a campaign number and possibly other parameters. I want to provide a route to do this BUT I want to get it right first time because obviously I cant easily change it once its being used externally.

How does something like this look?

routes.MapRoute(    '3rd-party-campaign-route',    'campaign/{destination}/{partnerid}/{campaignid}/{custom}',    new    {        controller = 'Campaign',        action = 'Redirect',        custom = (string)null // optional so we need to set it null     } );  

campaign : possibly don’t want the word ‘campaign’ in the actual link — since users will see it in the URL bar. i might change this to just something cryptic like ‘c’.

destination : dictates which page on our site the link will take the user to. For instance PR to direct the user to products page.

partnerid : the ID for the company that we’ve assigned – such as SO for Stack overflow.

campaignid : campaign id such as 123 – unique to each partner. I have realized that I think I’d prefer for the 3rd party company to be able to manage the campaign ids themselves rather than us providing a website to ‘create a campaign’. I’m not completely sure about this yet though.

custom : custom data (optional). i can add further custom data parameters without breaking existing URLS

Note: the reason i have ‘destination’ is because the campaign ID is decided upon by the client so they need to also tell us where the destination of that campaign is. Alternatively they could ‘register’ a campaign with us. This may be a better solution to avoid people putting in random campaign IDs but I’m not overly concerned about that and i think this system gives more flexibility.

In addition we want to know perhaps which image they used to link to us (so we can track which banner works the best). I THINK this is a candiate for a new campaignid as opposed to a custom data field but i’m not sure.

Currently I am using a very primitive URL such as http://example.com?cid=123. In this case the campaign ID needs to be issued to the third party and it just isn’t a very flexible system. I want to move immediately to a new system for new clients.

Any thoughts on future proofing this system? What may I have missed? I know i can always add new formats but I want to use this format as much as possible if that is a good idea.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T03:01:28+00:00Added an answer on May 11, 2026 at 3:01 am

    This URL:

    'campaign/{destination}/{partnerid}/{campaignid}/{custom}', 

    …doesn’t look like a resource to me, it looks like a remote method call. There is a lot of business logic here which is likely to change in the future. Also, it’s complicated. My gut instinct when designing URLs is that simpler is generally better. This goes double when you are handing the URL to an external partner.

    Uniform Resource Locators are supposed to specify, well, resources. The destination is certainly a resource (but more on this in a moment), and I think you could consider the campaign a resource. The partner is not a resource you serve. Custom is certainly not a resource, as it’s entirely undefined.

    I hear what you’re saying about not wanting to have to tell the partners to ‘create a campaign,’ but consider that you’re likely to eventually have to go down this road anyway. As soon as the campaign has any properties other than the partner identifier, you pretty much have to do this.

    So my first to conclusions are that you should probably get rid of the partner ID, and derive it from the campaign. Get rid of custom, too, and use query string parameters instead, should it be necessary. It is appropriate to use query string parameters to specify how to return a resource (as opposed to the identity of the resource).

    Removing those yields:

    'campaign/{destination}/{campaignid}', 

    OK, that’s simpler, but it still doesn’t look right. What’s destination doing in between campaign and campaign ID? One approach would be to rearrange things:

    'campaign/{campaignid}/{destination}', 

    Another would be to use Astoria-style indexing:

    'campaign({campaignid})/{destination}', 

    For some reason, this looks odd to a lot of people, but it’s entirely legal. Feel free to use other legal characters to separate campaign from the ID; the point here is that a / is not the only choice, and may not be the appropriate choice.

    However…

    One question we haven’t covered yet is what should happen if/when the user submits a valid destination, but an invalid campaign or partner ID. If the correct response is that the user should see an error, then all of the above is still valid. If, on the other hand, the correct response is that the user should be silently taken to the destination page anyway, then the campaign ID is really a query string parameter, not a part of the resource. Perhaps some partners wouldn’t like being given a URL with a question mark in it, but from a purely REST point of view, I think that’s the right approach, if the campaign ID’s validity does not determine where the user ends up. In this case, the URL would be:

    'campaign/{destination}', 

    …and you would add a query string parameter with the campaign ID.

    I realize that I haven’t given you a definite answer to your question. The trouble is that most of this rests on business considerations which you are probably aware of, but I’m certainly not. So I’m more trying to cover the philosophy of a REST-ful URL, rather than attempting to explain your business to you. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a fundamental question, but an important one none the less... When starting
Important: This question is getting quite long, if this is the first time you're
Hopefully, this question isn't a dumb as I fear it sounds, but it may
I've seen this question regading the importing of js-files related to the tag content
First of all (in case this is important) I'm using ActiveState's Perl (v5.8.7 built
I'm confused with how views are organized, and it is important to understand this
This one has me beat; I have a WPF window with two (important for
Edit: This was accidentally posted twice. Original: VB.NET Importing Classes I've seen some code
Edit 2: For a practical demonstration of why this remains important, look no further
After posting this question and reading that one I realized that it is very

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.