Nephryrinn Posted August 22, 2010 Posted August 22, 2010 I'm trying to add Google Analytics code dinamically, but I can't find any clue on making it on Apache's Rewrite. After googling I reached this IIS snippet: <rewrite> <outboundRules> <rule name="Add tracking script" patternSyntax="ExactMatch" preCondition=""> <match filterByTags="None" pattern="</body>" /> <action type="Rewrite" value="<script type='text/javascript'>//Your web analytics tracking code goes here...</script></body>" /> </rule> <preConditions> <preCondition name="IsHTML"> <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /> </preCondition> </preConditions> </outboundRules> </rewrite> Since we are in an Apache server, is there any way to make this work here? Else, is there any other way to archieve this? Thanks
Nephryrinn Posted August 24, 2010 Author Posted August 24, 2010 BUMPing it... Nobody will give me at least a clue?
rvt Posted August 25, 2010 Posted August 25, 2010 Does the top Google hit provide any help? http://cadlab.cs.ucla.edu/~kirill/analytics.html Seems to me like the easiest way is to follow Google's instructions and copy/paste it into your files.
Ashoat Posted August 27, 2010 Posted August 27, 2010 mod_rewrite isn't for dynamic code. Dynamic pages usually depend on scripting languages, with the exception of SSI. Anyways, this isn't a hosting support question.
Recommended Posts