How can I show subdomain data in GA4? - google-analytics-4

I am attempting to view subdomain data in GA4. My client has a main site, with several additional subdomains all using the same gtag.js tag (I confirmed that they are all using the same gtag). When I view data in Google Analytics, I'm not seeing the subdomain URLs.
I have attempted the following to access the data:
I set up the primary domain as an "Unwanted Referral", though I was not seeing the subdomains listed when viewing Reports > Acquisition > Traffic Acquisition > Type Referral in the local search > Switch Session Default Channel Group to Session source/medium).
I set up a segment: (Sessions > Hostname > subdomain url) but am not seeing the subdomains listed in the auto-populate dropdown. When I enter the subdomain manually, no data is shown.
The subdomains are showing as indexed in Google Search Console.
I confirmed that the site is using the correct configuration of Google's Global Site Tag (gtag.js). Specifically, the default setting of the cookie domain parameter is set to 'auto'.
I would expect to see subdomain data in Google Analytics, but am not getting anything. Would it be better to set unique accounts for each subdomain?

Cookie domain shouldn't matter here. GSC most definitely does not matter. Referral traffic shouldn't matter either. The start of your debugging should really be looking at all the distinct values of the hostname dimension.
If you don't see your hostname there, then the next step is verifying proper tracking on the missing hostname. Go there, pay attention to the tid value in the network request to google's collect endpoint. The tid should be exactly the same as the tid of the main site, unless you're using a different source for the subdomain, but it's unlikely.
Wrong tid is the most probable issue. If it's exactly the same, then check the dl field in the network request. Make sure it contains correct subdomain.
The next step I would take is checking the Filters of the property you're looking at. Make sure you're not filtering your traffic out.
If these don't help and you still have the issue, make the screenshot of your explorer where you pull out the hostname dimension by hit and show the screenshot of the ga4 event that you believe should be displayed there.

Related

How do you verify user-owned subdomains in Facebook?

As part of the upcoming changes to Facebook Ads, you now must verify ownership of your domain name.
We operate a SaaS platform where user content is hosted on subdomains (myaccount.example.com etc). We need these users to be able to verify ownership of their domain so they can track their own events. We have enabled them to add the meta tag on their domain, and this verifies okay.
<meta name="facebook-domain-verification" content="codefromfbhere" />
However, the problem is, when you go into 'Events manager' -> 'Aggregated event measurement' -> 'Configure web events', it shows me the root domain instead of the subdomain I just verified (e.g. example.com instead of myaccount.example.com).
This is possible, as Leadpages has achieved the same goal. When you add in a Leadpages subdomain, you're able to verify it via meta tag, and it shows the subdomain in the 'Web event configurations' area.
I don't see any extra headers that they have provided or anything else that would enable this.
How do you mark subdomains as independent from the eTLD+1?
I wanted to chime in with the perspective of someone who works for Facebook. For most businesses, even ones that host pages for other businesses, Aggregated Event Measurement without anything extra is the correct solution.
Advertisers who do not own their own domains will not be able to verify the domain for the purpose of event configuration in Ads Manager. Advertisers may consider purchasing their own domain to continue running their campaigns uninterrupted, or moving toward link clicks/landing page views for campaign optimization and reporting. We are currently investigating other solutions for this use case but do not have any additional information to share at this time.
For a very small number of businesses already on the Public Suffix List (PSL) subdomains will be able to get data as if they were a root domain. This is because being on the PSL basically makes the root domain name act as if it was a TLD (such as “co.uk“ or ”gov.au“). In almost every case it does not make sense for sites to request to be added to the PSL as this dramatically changes how the Public Suffix listed domain name will function.
The PSL process is intended only for platform providers that provide subdomains for large numbers of small businesses which really ought to be treated as though they were in fact separate domains.
The Public Suffix List is not useful, nor intended to be used as a means to gain additional subdomain events reporting. Adding a domain name to the PSL means that there will be total cookie separation between subdomains and that cookies will become disabled on the root domain. If you a domain gets added to the PSL you'll not have much control for that site itself. For example, if you have a /login page on that domain. This may not work as it does today if you proceeded with a PSL addition, as cookies may get disabled on the root domain.
It’s also important to note that browsers will enforce the behavior described based on their own update cadence of the PSL. Some browsers don't update their lists more regularly than bi-annually. This means that if you're on the list and a browser updates their copy of the list, and you later decide to not be on the list, there may not be an easy way to back out the effects; it's not as simple as submitting another request to get taken off of the list.
More information can be found at Facebook’s help center article here.
[Update Mar 19 2021]
Facebook just announced they will be supporting the Public Suffix List for domain verification and event configuration. This means that merchants using a registered domain on the Public Suffix List will be able to use that domain for verifying and configuring their top 8 events on the domain. For example, if myplatform.com is a registered domain on the Public Suffix List, then Jasper, a merchant with the subdomain jasper.myplatform.com, would now qualify as an effective eTLD+1 and would be able to verify "jasper.myplatform.com" and use it to configure their top 8 events in the web events configuration tool.
Read more here:
https://developers.facebook.com/docs/sharing/domain-verification
[Original Answer]
For the upcoming changes for Apple iOS 14.5, you can only verify root domain, which is example.com in your example in order to setup the web event configurations.
The only way you can do this is provide your client's a way to buy/setup their own domain on your service.
You may watch the webinar recording here
https://www.facebook.com/business/m/sessionsforsuccess

How to redirect a website according to country's IP address

I'm working on a messenger app whose server side code is developed in Erlang.
The problem which I'm facing is regarding redirection of website according to country specific domain.
For example: when user's types google.co in message box, it automatically displays google.co.uk, how can I redirect it to google.co.in if I'm in India?
For finding country's location, I found this library on github: https://github.com/mochi/egeoip
How can I use this geoLocation for redirecting to particular country specific website?
ScreenShot, when I entered facebook.com, it automatically displays preview in my local language.
But in case of my app, it shows preview in some foreign language, russian maybe.
I've read the comments, and since you are not considering having datasets as an option, I think what you may want to do is something like this:
First thing to understand is how those previews work. In any (popular) messaging app, if you type in a URL, the app will send a request to the URL and get the website metadata. Then it will be displayed in the UI.
The country detection, is a bit more complicated and done in a variety of ways. But thankfully, you (almost) don't have to do anything. This is a rather long topic, but I'll try to shorten it out.
Text Localization
In some websites (might be the case of Facebook's in your example), they do country detection on the application layer, and then based on that country, it will use a specific language for the website's text. This all usually happens before the website renders it's content, so you do not have to worry about it.
GeoDNS
This one occurs on the DNS layer, and probably the most popular. Domain names can be assigned a handful of IP addresses. These IPs can point to different versions of the website, and in the case of GeoDNS it will be up to the DNS manager to assign a country to an IP. So when a DNS query came from Russia, the requesting IP's country will be resolved and then the IP assigned to it (if any) will be returned. This is used by websites especially for country-specific features or content. Best example is Netflix.
Redirects
In case of Google redirecting you to a different domain, this might be how they do it. Country is being resolved via the IP address in the application (HTTP) layer, and then does a 301/302 redirect, pointing to the new domain name. This one, you may need to do something on. So given that your application needs to do an HTTP request to the URL the user has entered, if it returns a redirect, you must follow it. Many HTTP libs/clients already does this, but on some you might have to explicitly turn on the option to follow redirects.
One important thing to note is to do the HTTP request on the client side. Otherwise, you will be resolving to the same country (where your server resides) regardless of where your user is.

How to check the 302 redirect domain history?

I was buying a domain and I need to verify the history of the domain in-terms of 302 redirects on the domains. is there any way by which I can check a domains history
There are tools and sites available through which you can check their NS records which can be used before for redirection rules as per their name servers also some paid tools are available to get the entire domain history
Check whoisrequest.com and go to domain history.
Check archive.org if you would like to check what type of site it was
Check research.domaintools.com/research/hosting-history/ to get entire data
hope it helps!

How can I show a maintenance page when my web server is down or completely powered off?

I work for a company which has its own web server they are due to have a complete power blackout over the weekend, meaning their servers will be down.
Does anyone know a way we could present a down status on a maintenance page or some kind of redirect so we can at least inform our users that the site is down for maintenance and not just missing/broken?
The best way is probably setting up a redirection to dummy server on your load balancer or border routers. If you have no such thing, then you can either try asking your provider about the options, or temporarily change the DNS record, provided that you reduce DNS cache timeouts before and after the change, so it takes effect immediately.
Set up a server on another location and point their domains DNS record to that server during the blackout.
The redirect has to be carried out by the web server. No web server, no redirect. What you can do is to get another web site by a web hosting company (which will not be subject to your blackout), and configure it to route requests from your main dns to the temp site with just a plain notice html page, then remove it once power is restored. This can be done if you have the dns info from the primary site. You could also mirror the site this way, and then shut down the mirror and no one will be the wiser. Try http://siteground.com I have used them for years.
If you are using a load balancer, see if it supports a "Sorry Server" page. Most of them have this feature built in.

Google Apps: verify domain ownership using CNAME

I understand CNAME is an alias to another record. Since I am using melbourneIT for my domain name, when I set up Google Apps, I need to verify my domain name ownership through CNAME record change.
However when I see page: http://support.google.com/a/bin/answer.py?hl=en&answer=142005#CNAME (please tick "I want to verify using a CNAME record"), I am totally confused at what information to use in order to create the CNAME record for this verification purpose.
Please see below for the information from http://support.google.com/a/bin/answer.py?hl=en&answer=142005#CNAME:
Host Name/Alias Value/Destination
Custom URL: www ghs.google.com
Verification: googlefffggghhh12345 (your unique string) google.com
If my domain name is mydomainname.com, what should I put into my CNAME record (the value for HOSTNAME and POINTS TO, as in my DNS management panel shows)?
It's confusing because it looks like two entries. I think you want to use the second set of criteria for verification. So you'd enter the googlefffggghhh12345 as the alias(or host), and it would point to google.com.
You might want to do both or alternatively do mail as a cname and point it to ghs.google.com. You'll want to do that eventually anyway.
The cname, www pointing to ghs.google.com, is consistent with telling your domain host to check to see if there's a webpage setup in google sites and send people there. If there isn't one, and there isn't a sitemap within apps for one, I think the domain would just return to current hosting.