5
14 Comments

Reason behind adding Marketing on different domain and app on different?

Hi Everyone,

I have recently started working on my side project (SaaS). One pattern that I have noticed in many other amazing SaaS out there is that they keep two domains or one domain and a subdomain for the marketing site and the application site.

For eg: Main site can be acme.com and app/dashboard site be at app.acme.com

Is there any specific reason why dev's prefer to have it this way and not as acme.com for main and acme.com/app as protected pages for app things?

I am just curious to find the reasoning behind this. Let me know if my question needs more clarification. Thanks. :)

  1. 5

    There is a quite simple technical reason behind it. When using different (sub-)domains for your app and your landing-page you can route them way easier to different platforms/providers with DNS entries. E.g. you can build your landing-page with unicornplattform and build your app with Next.js and deploy it with Vercel. This is a little bit more cumbersome when you want to use sub-directories instead (and also some services do not support it).

    BUT: If your app relies on SEO from your landing-page or blog you should avoid this technique because Google rewards the rest of the page way more if you use sub-directories instead of sub-domains.

    1. 2

      Exactly what I was going to say, good answer 👍

    2. 1

      Thanks Dennis for the response. The SEO part totally makes sense to me.
      In my scenario I want to specifically block routes having /dashboard as those are private protected routes but I am still able to protect pages under /dashboard and the app works fine.
      I'm just curious to learn about cases when this might break, would it?

      Also can you point out with some examples about which services do not support this? Curious to know if it's something I'll have to rely on for this project in future

      My main reason to have both landing and dashboard under same domain with routes (basically same project) is that I want to reuse some components and theme and don't want to duplicate things with two separate project. Does this thing make sense?

      PS: I'm using NextJs and Vercel and oh boi, amazing experience :)

      1. 1

        If you are using the same technology/stack for landing-page and app you should totally do it like you proposed to (with protected & public routes). Sounds great. Good luck!

        1. 2

          Thanks. BTW your idea of 10 projects in 10 weeks sounds exciting. Good luck for that. Will be following up on Twitter with you on this. :)

  2. 1

    One benefit is your application site doesn't have to load fresh with nothing cached in 3s
    to please Google search. So adding that extra sdk to app doesn't need to be as concerning (or bother with lazy loading etc..)
    Personally I've just finished using netlify redirects to have different sites for landing, blog, and app all off subdirs instead. (I have public sections of app that I'd like to provide domain authority to main site)

    1. 1

      That makes a lot of sense, for a marketing site I probably don't want to maybe include libraries of code which are only part of the app section so removing those might speed up the load time on primary site. That was a great tip. I will be doing a speed load test once I have sufficient amount of tasks done on app side to test out the different.

      One thing is that I am using Nextjs as my primary framework for both marketing site and app and I am doing SSG (Static Site Generation) on all marketing pages so I think it should not affect much theoretically but definitely interested to see this practically after testing.

      Also I did not understood this section exactly

      Personally I've just finished using netlify redirects to have different sites for landing, blog, and app all off subdirs instead. (I have public sections of app that I'd like to provide domain authority to main site)

      Would you mind explaining it again please

      1. 1

        rather than just app.mydomain.com site I also use proxy at netlify to make
        mydomain.com/app alias app.mydomain.com
        Because I intend to allow public user generated content in app I am (hopefully) going to get users backlinking to their content to increase my domain authority in search

        1. 1

          That makes sense, I'll look into similar sort of thing with Vercel (where I'm currently hosting my webapp). I did read about proxy deployment on Vercel, something that I can read more into and try it out.
          Thanks for the clarification :)

  3. 1

    More on this debate here:

    FWIW, I prefer to keep the app and marketing site on the same domain. But I've designed the codebase to make it easy to separate later in case I change my mind.

    1. 1

      That's interesting, May I ask how exactly do you architect your codebase that it can be separated easily later.
      Some pointer that I should look out for?

      1. 1

        My app is a React SPA and I'm using Gatsby. The Gatsby build process can generate a static website (e.g. for marketing pages, blog, documentation) and also a web app. The entire web app is contained in src/app, while the static site is in the typical src/pages and src/posts. There is a little bit of code that is shared between the app and the website, but for the most part separating the app will be as simple as moving the src/app folder.

        See:
        https://www.gatsbyjs.com/docs/adding-app-and-website-functionality/
        https://www.gatsbyjs.com/docs/how-to/routing/client-only-routes-and-user-authentication/

        My reasons for single code base:

        • I'm a solo founder and I work on both coding and marketing, it doesn't make sense to separate the code base; the fact that everything is React / Gatsby reduces context switching.
        • Easier deployment (this might turn into a con later if I want separate the deployment process between the app and the website. This is the biggest complaint that Tyler Tringas has above).
        • Shared code/styles/components between the app and website
        • I want to have tight integration between the app and the website; for example, authenticated users that go from the app to the documentation will be on the same website, and I'll be able to customize the user experience on the website based on the user.

        Hope this helps, and let me know if you have any other questions.

        Good luck!

        1. 1

          That makes a lot of sense. In my scenario I'm using Next.js which also has a file based routing so all my app specific things goes inside my dashboard folder.. So i think this flow can help me to remove it and put into separate app as well if needed down the line.

          Also my reasons to have both of it same domain and subpaths matches all your points except the last bit so i feel this is a solid approach to go ahead with.

          Thanks for sharing.

Trending on Indie Hackers
Getting first 908 Paid Signups by Spending $353 ONLY. 25 comments I talked to 8 SaaS founders, these are the most common SaaS tools they use 20 comments What are your cold outreach conversion rates? Top 3 Metrics And Benchmarks To Track 19 comments How I Sourced 60% of Customers From Linkedin, Organically 12 comments Hero Section Copywriting Framework that Converts 3x 12 comments Promptzone - first-of-its-kind social media platform dedicated to all things AI. 8 comments