Skip to content

Commit

Permalink
Merge branch 'release/2.1.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
Saeed Marzban authored and Saeed Marzban committed Dec 23, 2016
2 parents 90dd064 + 26a77f6 commit 2fa251d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

2.1.4
-----
#. get language from request utils.py

2.1.3
-----
#. fix header name for Accepts-Language in tasks.py
Expand Down
7 changes: 5 additions & 2 deletions google_analytics/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import uuid

from django.conf import settings
from django.utils.translation import get_language_from_request

from google_analytics import CAMPAIGN_TRACKING_PARAMS

VERSION = '1'
Expand Down Expand Up @@ -114,10 +116,11 @@ def build_ga_params(request, account, path=None, event=None, referer=None, title
# construct the gif hit url
ga_url = "http://www.google-analytics.com/collect"
utm_url = ga_url + "?&" + urllib.urlencode(params)

locale = get_language_from_request(request)

return {'utm_url': utm_url,
'user_agent': user_agent,
'language': meta.get('HTTP_ACCEPT_LANGUAGE', ''),
'language': locale or settings.LANGUAGE_CODE,
'visitor_id': visitor_id,
'COOKIE_USER_PERSISTENCE': COOKIE_USER_PERSISTENCE,
'COOKIE_NAME': COOKIE_NAME,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='django-google-analytics-app',
version='2.1.3',
version='2.1.4',
description='Django Google Analytics app allowing for server side/non-js tracking.',
long_description=open('README.rst', 'r').read() + open('AUTHORS.rst', 'r').read() + open('CHANGELOG.rst', 'r').read(),
author='Praekelt Foundation',
Expand Down

0 comments on commit 2fa251d

Please sign in to comment.