From ebe764a8c5eb7642eeb0073d2c765487a196d40d Mon Sep 17 00:00:00 2001 From: prigiattiperrut <47340158+prigiattiperrut@users.noreply.github.com> Date: Fri, 9 Aug 2024 12:28:57 +0100 Subject: [PATCH 1/3] Update custom-domain.md --- src/connections/sources/custom-domain.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/connections/sources/custom-domain.md b/src/connections/sources/custom-domain.md index f0fc7e11e0..c9c4a26611 100644 --- a/src/connections/sources/custom-domain.md +++ b/src/connections/sources/custom-domain.md @@ -54,7 +54,8 @@ To configure Custom Domain: - **Is the domain name enabled for Content Policy**: Select either Yes or No. You are not required to create a Content Policy prior to requesting Custom Domain. - **Description**: Enter an optional description for your service request. If you are requesting Custom Domain for multiple workspaces, enter any additional workspace slugs and source names into this field. 4. Segment provides you with a list of nameservers you should add to your DNS. Once you receive the nameservers from Segment, update your DNS. -5. After you've updated your DNS, Segment verifies that you've made all required updates and then provides you with two custom domains, one for the Tracking API and a second for your CDN. +5. After you've updated your DNS, Segment verifies that you've made all required updates and then provides you with two custom domains, one for the Tracking API and a second for your CDN. +6. Once Custom Domain is enabled for your workspace, the Segment app generates a new JavaScript source code snippet for your Analytics.js sources. You can then copy and paste this snippet into the header of your website. 6. Update your JavaScript snippet to reference the new subdomains or use the new Tracking API custom domain as your endpoint for server library sources. ## FAQ @@ -62,12 +63,21 @@ To configure Custom Domain: ### What sources can I use with Custom Domain? Custom Domain was largely developed to support JavaScript sources. It helps with comprehensive collection of first-party data from your website when accessed over any platform (desktop, mobile, and more). You can use the subdomain for all other non-JavaScript sources as well, for consistency, but it will have no impact on data collection for those sources. -Once Custom Domain is enabled for your workspace, the Segment app generates a new JavaScript source code snippet for you to copy-paste into the header of your website. For non-JavaScript sources, you can use the sub-domain as an endpoint when using the Tracking API. +### How can I configure non-JavaScript sources to use Custom Domain? +Non-JavaScript sources should use Custom Domain primarily for consistency, as it does not impact data collection for these sources. Only Analytics.js sources will have Custom Domain configurations added to the source settings UI in Segment. For non-Analytics.js sources, you’ll need to update your implementation to use the subdomain as an endpoint when using the Tracking API. For example: -### Is this a fully-managed solution? What servers or infrastructure do I need to set up on my side for this proxy? -Yes, Custom Domain is a fully-managed solution. +* Server Sources: When sending data from server-side implementations, use the `host` configuration parameter to send data to your subdomain instead of the default Segment domain. + +* Mobile Sources: When sending data from mobile implementations, use the `apiHost` configuration parameter to send data to your subdomain instead of the default Segment domain. + +### Is there a benefit in migrating server-side sources over to client-side with Custom Domain? +Tracking data server-side is generally more reliable than tracking it client-side due to various device-based factors that can impact your tracking. For instance, users might block all cookies or use tools that interfere with network requests leaving the browser, leading to incomplete or inaccurate data collection when relying solely on client-side tracking. -You must be able to delegate a DNS subdomain to Segment and add the name servers Segment provides to your DNS. +For business-critical events, we strongly recommend keeping your tracking server-side. This approach ensures that your data is less susceptible to disruptions from client-side variables, resulting in more accurate and reliable tracking. + + +### Is this a fully-managed solution? What servers or infrastructure do I need to set up on my side for this proxy? +Yes, Custom Domain is a fully-managed solution. You must be able to delegate a DNS subdomain to Segment and add the name servers Segment provides to your DNS. First, decide on your subdomain and then delegate it to Segment. Segment then asks you to add a DNS NS record to your DNS with specific values to complete the DNS delegation. From there on, Segment fully manages the infrastructure for serving Analytics.js and ingesting events data through the subdomain. From a7326fc34acf0da319d9a9e264667849e0c47c27 Mon Sep 17 00:00:00 2001 From: prigiattiperrut <47340158+prigiattiperrut@users.noreply.github.com> Date: Fri, 9 Aug 2024 12:50:00 +0100 Subject: [PATCH 2/3] Update custom-domain.md --- src/connections/sources/custom-domain.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connections/sources/custom-domain.md b/src/connections/sources/custom-domain.md index c9c4a26611..e8a6db7139 100644 --- a/src/connections/sources/custom-domain.md +++ b/src/connections/sources/custom-domain.md @@ -56,7 +56,7 @@ To configure Custom Domain: 4. Segment provides you with a list of nameservers you should add to your DNS. Once you receive the nameservers from Segment, update your DNS. 5. After you've updated your DNS, Segment verifies that you've made all required updates and then provides you with two custom domains, one for the Tracking API and a second for your CDN. 6. Once Custom Domain is enabled for your workspace, the Segment app generates a new JavaScript source code snippet for your Analytics.js sources. You can then copy and paste this snippet into the header of your website. -6. Update your JavaScript snippet to reference the new subdomains or use the new Tracking API custom domain as your endpoint for server library sources. +7. Update your JavaScript snippet to reference the new subdomains or use the new Tracking API custom domain as your endpoint for server library sources. ## FAQ From d40c4ef88eb243fc8b7ba863420b6d0ab8777b21 Mon Sep 17 00:00:00 2001 From: forstisabella <92472883+forstisabella@users.noreply.github.com> Date: Tue, 13 Aug 2024 12:31:59 -0400 Subject: [PATCH 3/3] Apply suggestions from code review --- src/connections/sources/custom-domain.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/connections/sources/custom-domain.md b/src/connections/sources/custom-domain.md index e8a6db7139..cd4c2b2fc1 100644 --- a/src/connections/sources/custom-domain.md +++ b/src/connections/sources/custom-domain.md @@ -55,8 +55,7 @@ To configure Custom Domain: - **Description**: Enter an optional description for your service request. If you are requesting Custom Domain for multiple workspaces, enter any additional workspace slugs and source names into this field. 4. Segment provides you with a list of nameservers you should add to your DNS. Once you receive the nameservers from Segment, update your DNS. 5. After you've updated your DNS, Segment verifies that you've made all required updates and then provides you with two custom domains, one for the Tracking API and a second for your CDN. -6. Once Custom Domain is enabled for your workspace, the Segment app generates a new JavaScript source code snippet for your Analytics.js sources. You can then copy and paste this snippet into the header of your website. -7. Update your JavaScript snippet to reference the new subdomains or use the new Tracking API custom domain as your endpoint for server library sources. +6. Once Custom Domain is enabled for your workspace, the Segment app generates a new JavaScript source code snippet for your Analytics.js sources. Copy and paste this snippet into the header of your website. You can also use the subdomain provided for the Tracking API as the new endpoint for your server library sources. ## FAQ @@ -64,20 +63,22 @@ To configure Custom Domain: Custom Domain was largely developed to support JavaScript sources. It helps with comprehensive collection of first-party data from your website when accessed over any platform (desktop, mobile, and more). You can use the subdomain for all other non-JavaScript sources as well, for consistency, but it will have no impact on data collection for those sources. ### How can I configure non-JavaScript sources to use Custom Domain? -Non-JavaScript sources should use Custom Domain primarily for consistency, as it does not impact data collection for these sources. Only Analytics.js sources will have Custom Domain configurations added to the source settings UI in Segment. For non-Analytics.js sources, you’ll need to update your implementation to use the subdomain as an endpoint when using the Tracking API. For example: -* Server Sources: When sending data from server-side implementations, use the `host` configuration parameter to send data to your subdomain instead of the default Segment domain. +For non-Analytics.js sources, you’ll need to update your implementation to use the subdomain as an endpoint when using the Tracking API. For example: -* Mobile Sources: When sending data from mobile implementations, use the `apiHost` configuration parameter to send data to your subdomain instead of the default Segment domain. +- **Server Sources**: When sending data from server-side implementations, use the `host` configuration parameter to send data to your subdomain instead of the default Segment domain. +- **Mobile Sources**: When sending data from mobile implementations, use the `apiHost` configuration parameter to send data to your subdomain instead of the default Segment domain. ### Is there a benefit in migrating server-side sources over to client-side with Custom Domain? -Tracking data server-side is generally more reliable than tracking it client-side due to various device-based factors that can impact your tracking. For instance, users might block all cookies or use tools that interfere with network requests leaving the browser, leading to incomplete or inaccurate data collection when relying solely on client-side tracking. +Server-side tracking is generally more reliable than client-side tracking. For example, when tracking data client-side, you might lose data when users might block all cookies or use tools that interfere with network requests leaving the browser. -For business-critical events, we strongly recommend keeping your tracking server-side. This approach ensures that your data is less susceptible to disruptions from client-side variables, resulting in more accurate and reliable tracking. +For business-critical events, Segment recommends server-side data tracking. This approach means that your data is less susceptible to disruptions from client-side variables, which can result in more accurate and reliable tracking. ### Is this a fully-managed solution? What servers or infrastructure do I need to set up on my side for this proxy? -Yes, Custom Domain is a fully-managed solution. You must be able to delegate a DNS subdomain to Segment and add the name servers Segment provides to your DNS. +Yes, Custom Domain is a fully-managed solution. However, you must set up the following infrastructure on your end: +- Delegate a DNS subdomain to Segment +- Add the name servers Segment provides to your DNS First, decide on your subdomain and then delegate it to Segment. Segment then asks you to add a DNS NS record to your DNS with specific values to complete the DNS delegation. From there on, Segment fully manages the infrastructure for serving Analytics.js and ingesting events data through the subdomain.