afsmith / cc

chinchilla
0 stars 0 forks source link

Tacking pixel in gmail #178

Closed afsmith closed 10 years ago

afsmith commented 10 years ago

I was testing on staging and found when opening a kneto mail in gmail, the following error is generated:

Traceback (most recent call last):

 File "/opt/kneto/cc/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 113, in get_response
   response = callback(request, *callback_args, **callback_kwargs)

 File "/opt/kneto/cc/project/cc/apps/tracking/views.py", line 98, in track_email
   notify_email_opened(message_id, user_id, request)

 File "/opt/kneto/cc/project/cc/apps/cc_messages/services.py", line 199, in notify_email_opened
   1, message, recipient, request=request

 File "/opt/kneto/cc/project/cc/apps/cc_messages/services.py", line 173, in send_notification_email
   request=request

 File "/opt/kneto/cc/project/cc/apps/tracking/services.py", line 71, in create_tracking_log
   device = get_device_name(request)

 File "/opt/kneto/cc/project/cc/libs/utils.py", line 68, in get_device_name
   raise ValueError('Invalid request')

ValueError: Invalid request

<WSGIRequest
path:/track/email/105/45/,
GET:<QueryDict: {}>,
POST:<QueryDict: {}>,
COOKIES:{},
META:{u'CSRF_COOKIE': u'UmO7V2wVVK5pQ5JRTHSUcRc5xFv40jGT',
'HTTP_ACCEPT_ENCODING': 'gzip,deflate',
'HTTP_CONNECTION': 'close',
'HTTP_HOST': 'cc-stage.kneto.com',
'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7 (via ggpht.com GoogleImageProxy)',
'HTTP_X_FORWARDED_FOR': '66.249.81.184',
'HTTP_X_FORWARDED_PROTOCOL': 'https',
'HTTP_X_REAL_IP': '66.249.81.184',
'PATH_INFO': u'/track/email/105/45/',
'QUERY_STRING': '',
'RAW_URI': '/track/email/105/45/',
'REMOTE_ADDR': '66.249.81.184',
'REMOTE_PORT': '80',
'REQUEST_METHOD': 'GET',
'SCRIPT_NAME': u'',
'SERVER_NAME': 'cc-stage.kneto.com',
'SERVER_PORT': '80',
'SERVER_PROTOCOL': 'HTTP/1.0',
'SERVER_SOFTWARE': 'gunicorn/18.0',
'gunicorn.socket': <socket._socketobject object at 0x2fdc0c0>,
'wsgi.errors': <open file '<stderr>', mode 'w' at 0x7f471d2e4270>,
'wsgi.file_wrapper': <class gunicorn.http.wsgi.FileWrapper at 0x13e0530>,
'wsgi.input': <gunicorn.http.body.Body object at 0x2f32c90>,
'wsgi.multiprocess': True,
'wsgi.multithread': False,
'wsgi.run_once': False,
'wsgi.url_scheme': 'http',
'wsgi.version': (1, 0)}>

Do we need to add a new device type?

hieuh25 commented 10 years ago

No it was util script was buggy. Could you try again?

afsmith commented 10 years ago

works :) the only bummer is gmail runs the image requests through a proxy so we see the location as None, GB.

On Jun 3, 2014, at 2:59 PM, Hieu Nguyen notifications@github.com wrote:

No it was util script was buggy. Could you try again?

— Reply to this email directly or view it on GitHub.

hieuh25 commented 10 years ago

hmmhmm gmail... what should we do about it?

afsmith commented 10 years ago

I don’t think we can do much. Maybe label them as a gmail open and add some documentation.
Do you have any idea?

http://blog.mailchimp.com/how-gmails-image-caching-affects-open-tracking/

On Jun 4, 2014, at 12:37 AM, Hieu Nguyen notifications@github.com wrote:

hmmhmm gmail... what should we do about it?

— Reply to this email directly or view it on GitHub.