Closed ps92 closed 8 years ago
Thanks for report, please could you be more specific? Any error message appears? Anything in log? How exactly have been your links created?
I create or copy a template in the email, and I send it though a campaign. There is no error being created here, and the message gets send successfully. I get a count for the emails read too. Though, I do not get a read report for the links clicked, because the links do not get replaced with mautic's redirect link. I think there is the issue. I will do some more tests and try to locate the exact problem in a while.
@ps92 I'll mark your HTML code in your issue description as a code so it is visible if you don't mind...
@ps92 1) You HTML is not valid. [Invalid] Markup Validation of upload___Form Submission - W3C Markup Validator.pdf
2) links are not absolute (and they should) e.g. <a href="https://google.com">Internet</a>
@jkuchar is right. I missed that. You have to add http(s)://
at the beginning of the link href
attributes. I'm pretty sure that's the issue. Also the faebook is spelled wrong.
No dude, leave aside the link issue. The main issue is that it is not able to track the links. Mautic replaces the links with custom links, so it can track and update the database. Though, the replacement is not being carried out in the first hand. For example, see this link. https://www.dropbox.com/s/1kh9o415nh1hpty/a.png?dl=0 I sent emails to 14 addresses, (all of their were mine handled with +1, +2 trick), and I opened 5 of them and clicked first link in 3 and second in the rest of them. So, actually the main issue is that it is Mautic is not able to replace the links with its custom links.
It can track the email opens, since the pixel is fine. Though, links cannot be, since it is not encoded with custom mautic links.
It does not replace links because they are not valid.
@ps92 please, be polite to the people who want to help you. They might ignore your issue next time.
As @jkuchar said, the links from your HTML sample are not valid. Try to send the email with this HTML content:
<html>
<head>
<title></title>
</head>
<body>
<p><a href="https://google.com">Internet</a><br />
<a href="https://facebook.com">facebook</a><br />
<a href="http://hubble.com">Hubble </a></p>
</body>
</html>
and tell us if the tracking worked for you if the links are valid. Also, check the docs for tracking testing: https://www.mautic.org/docs/emails/troubleshooting.html
I am really sorry John. I did not mean to be rude. But, let me try again and I'll tell you if everything works fine.
John, I tried with your code. It still isn't working. Actually, Mautic is not able to replace the links with Mautic's /r/ links. You can see the results here. https://www.dropbox.com/s/mjefhjlo9emkwwj/3.png?dl=0
Please, re-send the email you've received from the testing of the email to john.linhart(at)mautic.org so I could inspect the source code.
Ok, so the email source showed that the links are converted to trackables:
<a href="http://mandrillapp.com/track/click/30792349/google.com?p=eyJzIjoic3ZnZGV0LW9UTGJQRWMtZU14MF9EalJNd0NFIiwidiI6MSwicCI6IntcInVcIjozMDc5MjM0OSxcInZcIjoxLFwidXJsXCI6XCJodHRwczpcXFwvXFxcL2dvb2dsZS5jb21cIixcImlkXCI6XCJkYmIwZjllOTFkMjU0MTZhODNkNTAyNTIzNzkxYjBlZFwiLFwidXJsX2lkc1wiOltcIjcyZmU5NWM1NTc2ZWM2MzRlMjE0ODE0YTMyYWI3ODU1NjhlZGE3NmFcIl19In0">Internet </a>
But if I follow redirects, the Mautic trackable is not one of them. If I send the same HTML content from my Mautic 1.2.4, I get the links converted to Mautic trackables:
<a href="http://[censored]/r/ae894c5d1dec7f00766ee10f1?ct=YTo0OntzOjY6InNvdXJjZSI7YToyOntpOjA7czo1OiJlbWFpbCI7aToxO2k6OTk7fXM6NToiZW1haWwiO2k6OTk7czo0OiJzdGF0IjtzOjEzOiI1NmMxZDAyNjBkNDJmIjtzOjQ6ImxlYWQiO2k6OTU7fQ%3D%3D" target="_blank">facebook</a>
I'm using my own SMTP server so it might be issue of Mandrill email transport. I changed the email transport to Mandrill, sent the email again and got this:
<a href="http://mandrillapp.com/track/click/30672391/localhost?p=eyJzIjoiYnlkLWl3RlozNjZuNGROYTV0S0FLR3R3LTcwIiwidiI6MSwicCI6IntcInVcIjozMDY3MjM5MSxcInZcIjoxLFwidXJsXCI6XCJodHRwOlxcXC9cXFwvbG9jYWxob3N0XFxcL21hdXRpYy1naXRodWJcXFwvaW5kZXhfZGV2LnBocFxcXC9yXFxcLzMxYTI4MGU4Njc5Y2IxMDM3OTBkOWNjNDc_Y3Q9WVRvME9udHpPalk2SW5OdmRYSmpaU0k3WVRveU9udHBPakE3Y3pvMU9pSmxiV0ZwYkNJN2FUb3hPMms2TVRBd08zMXpPalU2SW1WdFlXbHNJanRwT2pFd01EdHpPalE2SW5OMFlYUWlPM002TVRNNklqVTJZekZrTVdaa05ESTJOelVpTzNNNk5Eb2liR1ZoWkNJN2FUbzVOVHQ5XCIsXCJpZFwiOlwiOGY1NGVlNWQ4OWU5NDg1YWJmZjllMzhkZmY1MmUxZTRcIixcInVybF9pZHNcIjpbXCJhMGVkYTI3YmE3ZDM0ZDNhZWRkOWRlZjA2NjdiNjUyZjRlMWYxNTllXCJdfSJ9" target="_blank">Internet</a>
If I trace the redirects, it goes to Mautic right after Mandrill. So I'm getting out of ideas. It works for me. Are you sure you've sent the email from the list email to a list of leads?
Yes, exactly. The expected path redirects are Email link -> Mandrill -> Mautic -> the page. Though, the Mautic is missing from these steps, and it worked fine for me when I used to work with SMTP and v1.2.0. So, if I had to make a rough guess, it's something wrong during Mandrill API sending.
Mautic redirect is there if I send a list email from my Mautic via Mandrill, so I'm out of ideas why the redirect is missing when you do the same. Unless you are sending the test emails another way than as list emails or campaign emails.
@escopecz I assure you as of Feb 9, 2016 this is a very real problem. I managed to create an easily reproducible test case, tracked down the root cause and fixed it. It would be great if you could point me to the proper way to submit the fix.
Here are the details (re-posted from the Mautic's discussion board, thanks @zstephen):
I understand the accepted answer in this thread is that this issue was resolved with the 1.2.3 release but this is not correct. I was able to reproduce the problem both in the latest 1.2.3 release and the latest code cloned off the project's GitHub repository on Feb 9, 2016. I tried two different builds on two different servers. The issue exists on both of them and is easy to reproduce (see below).
I debugged the problem and determined the root cause. I also have a temporary workaround. I can also provide a proper fix if needed (see below):
Steps to reproduce Create a new email template with some test text and a single web link to www.google.com Create a list with only two leads in it Create a very simple workflow for the list from #2 using the email template from #1 - a single "Lead Lists" source connected to a single "Send Email" action Set the email send option to "Immediately" in the configuration. Note, this setting simply makes the test case more concise, the problem exists regardless of this setting (it's just a bit harder to debug) Execute the following two actions from CLI and make sure they execute without any errors: /path/to/mautic/app/console mautic:campaigns:update /path/to/mautic/app/console mautic:campaigns:trigger
Wait for the emails to arrive to their desired destinations Examine the emails closely, particularly the web link. In one of them it is pointing to www.google.com while in the other one it is pointing to your Mautic deployment instance. The problem is that only one of the emails has its web link replaced by a traceable link. The other one doesn't.
Expected result All of the emails should have traceable links.
Root cause The problem occurs in BuilderSubscriber::generateEmailTokens() method. In particular, there is some logic that tries to avoid replace regular links with the traceable ones more than one (per run) by setting the following static array variable to true "$emailTrackedLinks[$emailId]['contentReplaced'] = true;". The problem here is that "further up" the code the email content is flushed out for every lead causing the replaced email tokens to be skipped for the subsequent ones. It's a bit tricky to explain but basically the non-token-replaced email content is reset for every lead while it's token replacement happens only for the first one.
Workaround The simplest workaround is to make the following change in the file BuilderSubscriber.php - comment out the following line: $emailTrackedLinks[$emailId]['contentReplaced'] = true;
Proper fix The proper fix would involve not flushing out the tokenized email content for every lead. Instead the code should retain it as it's iterating through the leads. Since I've spent a good amount of time on this by now, I am pretty sure I could contribute a proper fix. I would appreciate if someone could point me to the accepted way to submit the fix back to the project's developers for a review.
Severity I believe this is a very serious problem, probably Sev2. The tricky bit here is that due to the nature of the problem most users might never notice the links aren't being replaced by traceable links. There is no obvious way to detect some sort of foul-play - to the person sending out the emails it would just appear nobody's clicking on the links! A lot of times having the leads visit the destination web site is the whole point of the email campaign non-sense, this bug basically defeats the whole point of the tool. IMHO, this problem needs to be fixed ASAP.
@ggioshvili, before I'll go through your issue to replicate it, could you please check if it is still problem with Mautic 1.2.4? Because several issues were fixed for Mandrill transport such as:
https://github.com/mautic/mautic/pull/1310 https://github.com/mautic/mautic/pull/1277
@escopecz I actually found this problem in 1.2.4. I retested it with 1.2.3 because in this discussion thread it sounded like the problem was addressed in 1.2.3 (I thought it might have been re-introduced in 1.2.4). Either way, I confirm the issue exists in 1.2.4 as well. Moreover, as I pointed out in my previous post, the issue also exists in the latest master. I cloned it off your GitHub project on Friday (Feb 12, 2016).
@ggioshvili do you use local SMTP or is it also Mandrill related?
@Jkuchar I don't use a local SMTP server. I use an external one (Zoho's email server). I don't believe this is related to Mandrill. I believe this is a global problem.
@ggioshvili I tried your solution. It still does not replace my links. I tracked the redirects, and Mautic does not still come in the picture.
@ps92 Does at least one of the emails have its link replaced with a traceable link?
@ps92 There might be something else going on in your setup. In my case (once I configured Mautic following the documentation) I was always getting at least one email with traceable links.
Yes, I think so. I tried your solution with commenting, it didn't work. Still trying to figure what us going wrong, even though I am following every correctly.
@ps92 Alright. Here's what I would suggest doing - instead of commenting out the line (the one from my earlier post), add a log statement with some custom message right above it (you can look at the other parts of the code to see how logging works). Then rerun the test case. If your custom log message does not appear when you run the campaign trigger command from CLI, it means you're not even hitting the part responsible for converting regular links to the traceable ones. Let me know how it goes. We can troubleshoot it from that point on.
@ggioshvili Thank you for your help. Your workaround works perfectly.
You welcome!
@ps92 @ggioshvili Please could you send Pull Request?
@jkuchar Would you like me to send pull request for the workaround described above or more comprehensive solution?
We are facing the same problem. @ggioshvili we would love the pull request for the comprehensive solution.
@ehillerbrand I am a bit tied up right now but I'll put something together in couple of days. Meanwhile, could you try the workaround?
@ggioshvili I wish I found your comment about contentReplaced earlier, it would save me 4 hours of debugging just to find it :) Thanks!
Hate to necro an old, old thread, but we're also seeing this issue in Mautic 2.4.0. Shouldn't this be a higher priority issue?
I am wondering if #1524 was supposed to fix this, but hasn't?
I am using v1.2.4.
The links are not being replaced in any campaigns. Example: