Add hostname to GoogleAnalyticsTrackingPixel.
This commit is contained in:
@@ -108,6 +108,7 @@ def _get_google_analytics_tracking_url(context):
|
||||
message.send_uuid,
|
||||
message.uuid,
|
||||
),
|
||||
document_host=site.domain.rstrip('/')
|
||||
)
|
||||
course_ids = context.get('course_ids')
|
||||
if course_ids is not None and len(course_ids) > 0:
|
||||
|
||||
@@ -102,7 +102,8 @@ class TestGoogleAnalyticsPixelTag(QueryStringAssertionMixin, EmailTemplateTagMix
|
||||
dp='/email/test_app_label/test_name/{send_uuid}/{uuid}'.format(
|
||||
send_uuid=self.message.send_uuid,
|
||||
uuid=self.message.uuid,
|
||||
)
|
||||
),
|
||||
dh=self.fake_request.site.domain,
|
||||
)
|
||||
|
||||
def test_missing_request(self):
|
||||
|
||||
@@ -99,6 +99,7 @@ class TestGoogleAnalyticsTrackingPixel(QueryStringAssertionMixin, CacheIsolation
|
||||
event_action='test_ea',
|
||||
event_label='test_el',
|
||||
document_path='test_dp',
|
||||
document_host='test_host.com',
|
||||
client_id='123456.123456',
|
||||
)
|
||||
self.assertIsNotNone(pixel.generate_image_url())
|
||||
@@ -108,7 +109,7 @@ class TestGoogleAnalyticsTrackingPixel(QueryStringAssertionMixin, CacheIsolation
|
||||
netloc='www.google-analytics.com',
|
||||
path='/collect',
|
||||
query='tid=UA-123456-1&v=2&t=ev&cs=test_cs&cm=test_cm&cn=test_cn&ec=test_ec&ea=test_ea&el=test_el'
|
||||
'&dp=test_dp&cid=123456.123456&cc=test_cc'
|
||||
'&dp=test_dp&dh=test_host.com&cid=123456.123456&cc=test_cc'
|
||||
)
|
||||
|
||||
def test_missing_settings(self):
|
||||
|
||||
@@ -69,6 +69,7 @@ class GoogleAnalyticsTrackingPixel(object):
|
||||
event_label = attr.ib(default=None, metadata={'param_name': 'el'})
|
||||
|
||||
document_path = attr.ib(default=None, metadata={'param_name': 'dp'})
|
||||
document_host = attr.ib(default=None, metadata={'param_name': 'dh'})
|
||||
|
||||
user_id = attr.ib(default=None, metadata={'param_name': 'uid'})
|
||||
client_id = attr.ib(default=ANONYMOUS_USER_CLIENT_ID, metadata={'param_name': 'cid'})
|
||||
|
||||
Reference in New Issue
Block a user