Mobile app version of vmapp.org
Login or Join
Vandalay111

: 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

@Vandalay111

Posted in: #Google #GoogleAnalytics #Iis7

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>

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Vandalay111

1 Comments

Sorted by latest first Latest Oldest Best

 

@Marchetta884

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme