Are https://sub.example.com and https://example.com considered Cross-Domain? - dns

I'm tracking google ads, my user will first go to
User goes to: https://example.com
And then click a link
User will go through multiple redirects
Finally redirect to https://sub.example.com
My question is, are https://sub.example.com and https://example.com considered Cross-Domain?
If they are Cross-Domain, should I enable google ads Cross-Domain tracking?

They are considered different domains, but you do NOT need to use cross domain tracking. You just need to add one to the referral exclusion list. Here's a great article on how to do just that: https://www.analyticsmania.com/post/subdomain-tracking-with-google-analytics-and-google-tag-manager/

Related

How do I redirect OldSite.com to NewSite.com/Sub/NewPage

I need to redirect several URLs to a new site that will have pages that replace the old sites. I don't care if the URL is masked or not. I just need the URL's to go to the new pages on the new combined site.
For example:
Oldsite.com redirects to NewSite.com/Sub/NewPage
Oldsite2.com redirects to NewSite.com/Sub/NewPage2
Oldsite3.com redirects to NewSite.com/Sub/NewPage3
and so on.
I've tried domain forwarding on the DNS level, but that isn't working (likely because of the subdirectories).
Problem is the New site was developed in Webflow and I don't have access to implement custom code for redirects.
My thought is to host a separate site to act as a hub that handles all the custom redirects to the New webflow site.
Any help or insight would be greatly appreciated.
Your scenario here isn't entirely clear on the types of redirections you're attempting to do.
If you're trying to redirect all paths from the old site to a specific destination page, like this...
oldsite.com/* ➜ newsite.com/sub/newpage
...many modern DNS providers support that.
If yours does not, you can switch your nameservers to Cloudflare DNS free edition, and you'll have the ability to define up to 3 page rules that support wildcard redirections like this.

DNS records to redirect everything to another domain

I have several domains:
example.co
example.io
example.com
I want to redirect everything from .co and .io to their counterparts in .com, which means:
sub.example.co => sub.example.com
api.example.io => api.example.com
example.co => example.com
...
I've heard about DNAME records, but cloudflare do not support them.
If you just mean normal url forwarding, according to this link, you just have to:
Log into your Cloudflare account.
Click the appropriate Cloudflare account for the domain where you want to add URL forwarding.
Click the Page Rules app.
Under Page Rules, click Create Page Rule. The Create Page Rule for dialog opens.
Under If the URL matches, enter the URL or URL pattern that should match the rule. Learn more about wildcard matching.
Next, click Add a Setting.
Choose Forwarding URL from the drop down menu.
Click Select Status Code and choose 301 (Permanent Redirect) or 302 (Temporary Redirect).
Enter the destination URL.
To finish, click Save and Deploy.
Hope I could help, if not, the page contains some other interesting solutions under the Advanced Forwarding Options, such as using variables.
Page Rules are great and will help to route the traffic as you want. There is a good tutorial with examples here, https://community.cloudflare.com/t/using-page-rules-to-perform-redirects/55386. In particular, the section about using variables will be particularly useful for what you want to accomplish.
If you have questions are you work through the rules, let us know at the Cloudflare Community, Community Tip - Welcome stackoverflow Visitors, https://community.cloudflare.com/t/community-tip-welcome-stackoverflow-visitors/99529
+1 to "Page Rules works with both HTTP and HTTPS" from Faiz! That is correct. This statement is not accurate -> "unfortunately page rules only works with http".

Same website on same domain name with different extensions - i.e. .com and .co.uk

What is best practice for doing this? Should I have duplicate content at each domain or should I redirect from one to the the other, i.e. all traffic to the .co.uk domain redirected to the .com domain?
Best practice is to send them all to one web server.
By default the server will not care which domain is pointed at it and will show the home page as domainx.com if you to it from domainx.com.
However there are two possible issues with this that come to mind:
The person who created the website hopefully only used relative links. (The contact us button points to contactus.htm instead of http://domainx.com/contactus.htm ) If not, some links might change the user from domainx.co.uk to domainx.com.
Search Engine Optimisation: Its better SEO wise if all the links to your site point to one domain name rather than appearing as several less popular sites.
You can get everyone on the same site by using a RewriteRule or 301 Redirect to the primary site. Or you can make every hyperlink on the site absolute and point to the primary domain.

Combine variations of the same domain in Google Analytics

Is there a way of forcing Google Analytics to combine variations of the same domain so it treats all subsequent visits from one user to any of these URLs as the same user? Here's an example:
http://www.example.com/mypage.php
https://www.example.com/mypage.php
http://example.com/mypage.php
https://example.com/mypage.php
What I hope to achieve is a setup where if a single user clicked each of these links, the results would appear in Analytics as:
http://www.example.com/mypage.php - Pageviews: 4 Users: 1
This question expands on this one from earlier
As I understand it, if I were to add a global 301 redirect to my .htaccess file, the user would be automatically redirected to whatever domain I specify. Is this the best solution?
The answer you linked to is outdated (if it was ever right). If you use Universal Analytics and set the cookie domain parameer to auto (which is the default) the cookie will be set for the domain and all subdomains:
Automatic Cookie Domain Configuration simplifies cross domain tracking
implementations by automatically writing cookies to the highest level
domain possible when the auto parameter is used. When used on the
domain www.example.co.uk, it will try to write cookies in the
following order:
co.uk
example.co.uk
www.example.co.uk
(see documentation). So you will have a cookie for example.co.uk on both domain and www subdomain which is valid for both.
Having said that, you should still use the 301 for SEO reasons (to avoid duplicate content, plus Google announced last year that ssl is a ranking factor now so you might want to use your https pages only).

Implications of not forwarding http:// to http://www

my company is running IIS and DNN (I'm not a server guy, so color me ignorant), and I've read previous that you should either redirect your .http://www.mydomain to .http://mydomain or Vice Versa. Can anyone give me reasons to do this? (periods "prepended" to remove href)
From what I understand, it's because search engines see those as two different 'sites' (Even when visiting one or the other, I can be logged into one but not the other).
I also heard it can be a duplicate content problem, which search engines dislike.
Just looking for some professional insight, will help me and others.
Thanks!
This allows your site to be more SEO-friendly. Search engine crawlers will view these as two different URLs. That will cause your site's ranking in search engines to have multiple rankings for the same content.
ScottGu describes the problem and how to go about fixing it in a blog post:
http://weblogs.asp.net/scottgu/archive/2010/04/20/tip-trick-fix-common-seo-problems-using-the-url-rewrite-extension.aspx
Although it's mostly for SEO, there is also a potential usability issue in that a user who logs in on www.domain.com may get cookies that only work on the www subdomain and will be forced to log in again if they ever follow a link to domain.com (without the www prefix).
In addition to the SEO-friendlyness this also prevents some errors that might come up when both, with and without www works.
for example a user could login on www.yourdomain.com and would receive a cookie. later he visit your site via yourdomain.com and the cookie would not apply there.

Resources