putyourlightson / craft-campaign

Send and manage email campaigns, contacts and mailing lists in Craft CMS.
https://putyourlightson.com/plugins/campaign
Other
64 stars 24 forks source link

Errors in Rollbar logs - Object Not Found Matching Id:2, MethodName:update, ParamCount:4 #478

Closed bossanova808 closed 2 months ago

bossanova808 commented 3 months ago

Support Request

Hi Ben

Am seeing some of these pop out, but can't work out why or what they relate to - but seems to be happening with each send-out, at least a few times. No real idea how to begin debugging this one!

Error showing in Rollbar:

(unknown): "Object Not Found Matching Id:2, MethodName:update, ParamCount:4"

The URL: https://imagescience.com.au/actions/campaign/t/click?cid=d8fcdf3be9c022eIT&sid=f9995011cb7e9dvbb&lid=y999501ea4dcbfkub

(I can't immediately work out what each of those params relate to and it's all a bit complicated as the actual URLs are wrapped with Postmark tracking, e.g.

https://click.pstmrk.it/3s/imagescience.com.au%2Factions%2Fcampaign%2Ft%2Fclick%3Fcid%3Dc5e9fd2003bb51T8X%26sid%3Ds6662788ba4d6ciao%26lid%3Dl666278df1dbe8xxp/zSYa/etS1AQ/AQ/fe2f71f7-25c0-470sdf8-80a2-0dc4259e2145/3/4jY16x

Stack Trace from manually hitting that URL:

yii\web\NotFoundHttpException: Link not found. in /home/forge/imagescience.com.au/releases/dev/vendor/putyourlightson/craft-campaign/src/controllers/TrackerController.php:65
Stack trace:
#0 [internal function]: putyourlightson\campaign\controllers\TrackerController->actionClick()
#1 /home/forge/imagescience.com.au/releases/dev/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#2 /home/forge/imagescience.com.au/releases/dev/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#3 /home/forge/imagescience.com.au/releases/dev/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('...', Array)
#4 /home/forge/imagescience.com.au/releases/dev/vendor/craftcms/cms/src/web/Application.php(340): yii\base\Module->runAction('...', Array)
#5 /home/forge/imagescience.com.au/releases/dev/vendor/craftcms/cms/src/web/Application.php(641): craft\web\Application->runAction('...', Array)
#6 /home/forge/imagescience.com.au/releases/dev/vendor/craftcms/cms/src/web/Application.php(302): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#7 /home/forge/imagescience.com.au/releases/dev/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#8 /home/forge/imagescience.com.au/releases/dev/web/index.php(12): yii\base\Application->run()
#9 {main}

Plugin Version

2.15.3

bencroker commented 3 months ago

Could it be that the campaign that is tracking links (with CID d8fcdf3be9c022eIT) has since been deleted or closed?

Ideally, you should disable link tracking (and unsubscribe links, see the note here) in Postmark, and let Campaign handle the link tracking. https://postmarkapp.com/developer/user-guide/tracking-links#enabling-link-tracking

bossanova808 commented 2 months ago

I disabled the double unsubs right from the beginning. But I am surprised I had Postmark link tracking on - I think I wanted to track opens (this is handy for various business reasons) - but just went ahead and re-enabled link tracking at the same time - will turn that off.

Digging in deeper, it appears that these may in fact be related to client side JS errors (https://www.techighness.com/post/javascript-rollbar-unknown-unhandled-rejection-error-getting-reason-from-event/ and https://github.com/getsentry/sentry-javascript/issues/3440#issuecomment-865857552) - due to (possibly?) Outlook and email link scanning. It's possible they are triggered by a site timeout happening as I (sometimes?) see that in the logs before a run of these. (And those only really seem to happen when some sort of bot is aggressively scanning the site, so I am using Cloudflare to reduce that, sigh).

I think these errors are a bit of a furphy, to be honest, as all the functionality seems to be working (tracking in Campaign (and Postmark actually!) - and unsubscribes etc.

I'll keep an eye on it but can likely close this - but before that, one dumb question - how does one actually search for a campaign by ID? Am guessing there is no UI way, and I have to do that in code?

bossanova808 commented 2 months ago

...while I have you, should I be actually seeing those 1-click unsubscribe things in Google?

I kind of expected to, per the screenshots I've seen (e.g. your article), but as yet I am not seeing them:

image

If I view the email source in gmail (web), I can see the headers so I presume everything is technically ok:

List-Unsubscribe: <https://imagescience.com.au/actions/campaign/t/one-click-unsubscribe?cid=c6672808b25ebagjs&sid=s6662988ba4d6ciao>
List-Unsubscribe-Post: List-Unsubscribe=One-Click

...but seems odd that it's not showing up in Google's own email...

bencroker commented 2 months ago

Yeah, I wouldn’t worry about those errors, and your explanation about email clients scanning links sounds feasible.

I'll keep an eye on it but can likely close this - but before that, one dumb question - how does one actually search for a campaign by ID? Am guessing there is no UI way, and I have to do that in code?

Campaigns are element types, so you can search as with any other element types using Twig or PHP. Or, do you mean in the CP? If so, then the UI is controlled by Craft, so whatever you can do with entries, you can do with campaigns.

...while I have you, should I be actually seeing those 1-click unsubscribe things in Google?

Yes, this is how it should appear in GMail.

screenshot-7tKVJeFA@2x

bossanova808 commented 2 months ago

I did indeed mean the CP. (I find it's a common irritant with Craft, trying to find things by something like an ID, vs a text/title search, especially when digging in to problems. One doesn't always have code tools/dev envs to hand and given an ID it would be handy to be able to get a clue as to which specific things it refers to without having to make a template or whatever to do it).

Hmm, I am definitely not seeing that Unsubscribe link/text in Gmail, but I can definitely see the headers.

Apparently the 'Unsubscribe' thing shows only after a while once Google assesses you're not using it to insert dodgy/tracking links (https://support.google.com/mail/thread/49653586?hl=en&msgid=49801705)

...however, from what I read, there should at least always be an unsubscribe in the toggle menu next to 'To Me' apparently, and I am also not seeing that:

image

But perhaps that is wrong - maybe it also doesn't appear there sue to reputation?

Google themselves don't seem clear on this. I have checked and SPF, DKIM, DMARC are all good, with Google Postmaster's tools the domain is verified and the spam rate is 0.1% or less across the longest period they show.

Anyway, I can't see any issues in the headers, the email did not go to spam, and I can't think of anything else to check or do?? As usual with Google things, it's frustratingly opaque.

bossanova808 commented 2 months ago

(Indeed every metric in all of Postmaster tools is looking 100% good)

bencroker commented 2 months ago

Sounds good, marking this complete.