: Track Google Analytics from a redirected domain using IIS I have a olddomain.com that redirects to newdomain.com and we want to know the best way to track how many people are coming from olddomain.com
I have a olddomain.com that redirects to newdomain.com and we want to know the best way to track how many people are coming from olddomain.com on Google Analytics?
Currently I have two rewrite rules which basically just redirects olddomain.com to newdomain.com like below. What I want to accomplish is to be able to somehow log into Google Analytics and track how many times visitors came from olddomain.com. I have seen this article but its for Apache server using .htaccess. I would like to know how to do this with IIS 7 using rewrite rules or redirects so GA can track these also.
<rule name="Force HTTPS and use production domain - olddomain.com" stopProcessing="false">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^m.olddomain.com$" />
<add input="{HTTP_HOST}" pattern="^olddomain.com$" />
<add input="{HTTP_HOST}" pattern="^ww2.olddomain.com$" />
<add input="{HTTP_HOST}" pattern="^www.olddomain.com$" />
</conditions>
<action type="Redirect" url="https://www.newdomain.com{REQUEST_URI}" appendQueryString="false" redirectType="Permanent" />
</rule>
<rule name="Force HTTPS and use production domain - olddomain.com" stopProcessing="false">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^m.olddomain.com$" />
<add input="{HTTP_HOST}" pattern="^olddomain.com$" />
<add input="{HTTP_HOST}" pattern="^ww2.olddomain.com$" />
<add input="{HTTP_HOST}" pattern="^www.olddomain.com$" />
</conditions>
<action type="Redirect" url="https://www.newdomain.com{REQUEST_URI}" appendQueryString="false" redirectType="Permanent" />
</rule>
More posts by @Vandalay111
1 Comments
Sorted by latest first Latest Oldest Best
You could change your redirected URL to have something like
?redirect
appended to the end of it. It would have no effect on the page, but in GA you could filter those URLs out to get a count.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.