Analytics
2.2K members online now
Understand information in your reports and troubleshoot reporting issues such as self-referrals, (not set) data, and inaccurate information
 
Guide Me
star_border
Reply

Email event for emails sent using javax.mail not coming in reports

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi everyone,
I am using google analytics email open event tracking using the link: https://developers.google.com/analytics/devguides/collection/protocol/v1/email . I have attached the tracking image with my email template with proper parameters. When I am attaching the image with any test html email template and sending it with my gmail account, the email open event is being seen in Realtime events as well as Behaviour->Events->Top Events  report in about same time or with a little delay (max 24hrs) and everything works as expected. But the problem arises when I use javax.mail library to generate my html template (with image attached) and send it, the email open events are tracked only in Realtime, but they never show in Behavior's Top events report.
Any help/guidance is highly appreciated.
Thanks in advance.
Note: 1. On June 1st 2017, it has been one week since my email tracking project has become live. I think 7 days is a decent time for the data to be updated in reports from the realtime.
          2. There in one filter in my account which excludes traffic from a particular IP.
          3. Yes, I am selecting present date while checking reports in Behavior. (Anyway previous   days' data should come in any case)

1 Expert replyverified_user

Email event for emails sent using javax.mail not coming in reports

Rising Star
# 2
Rising Star

Hi Shavangi,

 

Post your MP hit (from the actual send, not the test) here so we can take a look to see if it's malformed in any way.  ( I know you tested it.)  Smiley Happy

 

Also, you've check your unfiltered view too?

 

Best,

 

Theo Bennett

Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn

Email event for emails sent using javax.mail not coming in reports

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Theo,
Thank you so much for helping me.
Correct me if I am wrong; by posting my MP hit, do you mean a screen shot of the real time events? If no, what should I post so that the problem becomes clearer. Also, to check for unfiltered view, do I need to delete the filter for that view and then wait for few days?

Thanks,
Shivangi

Email event for emails sent using javax.mail not coming in reports

Rising Star
# 4
Rising Star

Hi Shivangi,

 

You should always keep a clean view in which no filters are applied.  Smiley Happy

 

I meant the string that is embedded in the actual email.  If you've seeded the list with yourself, you'd want to look at what you received.  It should look something like this:

 

www.google-analytics.com?v=1&t=pageview&tid=UA-11111-2&cid=123456.455678....

 

Best,

 

Theo

 

 

Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn

Email event for emails sent using javax.mail not coming in reports

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Hi Theo,
The filter has been applied by someone in our company. I will check if I can delete the filter after the permission.
Speaking about the string which I have embedded, we have a function (let's say generator) which generates mail template (to be sent in email) from html with the help of Apache velocity engine. It is in this html file I have put the tracking string. The generator function is also passed parameters which become parameters in our GA tracking string.
This is the tracking string put in the end of html file:
<img src="http://www.google-analytics.com/collect?v=1&amp;tid=UA-11111111-1&amp;uid=${userId}&amp;t=event&amp;...">
The generator function is passed string userId and string label which  replace "userId" and "label" in the tracking string.

This is in contrast with the mails I sent to test through my gmail account. I used some websites to generate mail from HTML, put the above GA tracking string in html but hard coded the "uid" and "el" with some random values, like this:

<img src="http://www.google-analytics.com/collect?v=1&amp;tid=UA-11111111-1&amp;uid=12340&amp;t=event&amp;el=t...">

Thanks,
Shivangi

Email event for emails sent using javax.mail not coming in reports

Rising Star
# 6
Rising Star

Hi Shivangi,

 

I see the cid in your test but not in the actual one that was generated.  Cid is required. It should also be the actual cid, harvested from the session whenever possible.

 

Best,

 

Theo Bennett

Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn

Email event for emails sent using javax.mail not coming in reports

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Hi Theo,
Is cid required even after I have given uid ? The documentation mentions that each is optional if other is present, i.e. cid is optional if uid is there and uid is optional if cid is there.
https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#uid

Also if cid is required even after providing uid, can they be same? like cid = uid = 12340?
Thanks again,
Shivangi

Marked as Best Answer.
Solution
Accepted by topic author Shivangi S
June

Email event for emails sent using javax.mail not coming in reports

Rising Star
# 8
Rising Star

Hi Shivangi,

 

I believe it's still required. 

 

https://developers.google.com/analytics/devguides/collection/protocol/v1/email

"

User ID (&uid)

If you use userID to measure users cross device, you may use that for emails in addition to the Client ID."

(emphasis added)

 

Also check hit builder. i don't think it will validate without cid

 

https://ga-dev-tools.appspot.com/hit-builder/

 

Try it and check your results.

 

Best practice, cid should be what you've harvested from the site for the user when they signed up.  Absent to that, you can send what you're using for user id.

 

Post back here and let us all know if, with cid included you get data, as hit builder error messaging is odd and -- as you pointed out -- the documentation is not consistent.

 

Best,

 

Theo Bennett

 

 

Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn

Email event for emails sent using javax.mail not coming in reports

Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭

Hi Theo,
Thank you for the emphasizing the point.  According to the definition of User ID (&uid) in the link: https://developers.google.com/analytics/devguides/collection/protocol/v1/email , I should use cid and then uid in addition to cid.
I will also check the Hit Builder. Thank you for pointing this tool I can use to validate.
I will also keep in mind the best practice for userId and cid values.
I will make the changes you suggested and post back if it worked.

Thanks,
Shivangi

Re: Email event for emails sent using javax.mail not coming in reports

[ Edited ]
Visitor ✭ ✭ ✭
# 10
Visitor ✭ ✭ ✭

Hi Theo,

Here is the summary of what I tried this week:
1. I checked the hit builder with 3 cases :  first with only cid, second with only uid and third with cid and uid. In all the three cases the hits were validated, but when I sent the data (with proper labels to distinguish the cases) to GA, the case with only cid, and the case with both cid and uid appeared in reports, the case with only uid didn't.
2. So after adding the cid parameter in my tracking string and deploying this fix, I am seeing the data appear in reports.

Some issues still unsolved:
1. Is there any way to verify that the data which is now coming in reports is from the real time events captured after the fix was made by me? I mean to ask that is there any chance that the real events which were captured before the fix was made are coming to reports now... ? I am thinking about this possibility because there is still one particular label which comes in real time  but not in my behavior report. Today it has been 2 days since the fix was deployed.
2. So, I guess there is discrepancy in the links: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#uid   and https://developers.google.com/analytics/devguides/collection/protocol/v1/email  about the cid parameter being optional with uid or vice-versa. Do correct me if I am wrong. Smiley Happy

Thanks a ton,
Shivangi