djangosnippets.org: Latest snippets tagged with 'analytics'https://djangosnippets.org/tags/analytics/2009-10-24T23:16:27.947836-05:00Strip Google Analytics cookies for caching middleware purposes
2009-10-24T23:16:27.947836-05:00nfhttps://djangosnippets.org/snippets/1772/<p>You may notice that using Google Analytics's 'urchin' with the CacheMiddleware and SessionMiddleware or AuthenticationMiddleware middleware classes means that nothing is ever cached.</p>
<p>Google Analytics updates its cookies with every page view, and the Auth/Session middlewares add cookies to the caching engine's 'Vary' list. This means every page view is …</p>
Freely redistributableGoogle Analytics Template Tag
2009-07-28T04:58:17.740728-05:00jarofgreenhttps://djangosnippets.org/snippets/1656/<p>Includes the Javascript for Google Analytics. Will not show Google Analytics code when DEBUG is on or to staff users.</p>
<p>Use {% googleanalyticsjs %} in your templates.</p>
<p>You must set something like</p>
<p>GOOGLE_ANALYTICS_CODE = "UA-1234567-1"</p>
<p>in your settings file.</p>
<p>Assumes 'user' in your template variables is request.user, which it will …</p>
Freely redistributableGoogle Analytics Template Tag
2007-11-05T12:21:18.343630-06:00blinkshttps://djangosnippets.org/snippets/457/<p>Use <code>{% urchin "UA-1234567-1" %}</code> to insert the Javascript snippet for a Google Analytics site.</p>
Freely redistributable