I send a newsletter via CiviMail and in it there is a style link to load a Google font. This link gets many hits in the Mailing report, but has no relevance for me. Is there a way to exclude this specific link from the Mailing statistics report?

1 Answer 1


I didn't know you could use webfonts remotely in emails (or, it hadn't occurred to me). Here are some ways you could approach this - pick one! (Or more.)

Modify the recorded data

The "visit" records are stored in DB table civicrm_mailing_event_trackable_url_open and the URLs themselves are in civicrm_mailing_trackable_url. By removing matching entries from civicrm_mailing_event_trackable_url_open you'll zero those numbers off the top of your report.

Don't remove the entries in civicrm_mailing_trackable_url or the redirects to webfonts will stop working, breaking the font in future views.

Modify the recorded data (automated)

Once you have the query for the above, you could add a "cleanup" job to remove clicks where the URL matches (say) /.*(css|woff)$/. This would mean your reports stay clean - but cleanup jobs are a "code smell" IMO, so it's not a great solution.

Change the email - embed the font

You could potentially base64 encode the webfont into the email (this should increase the number of people seeing it in the correct font). That would remove the remote request entirely, but it won't work for an email that has flown!

Change the email - don't use a font

It's an option ... obviously you went to some effort to put a font in, but I'll include this for completeness :)

Exclude .(woff|css) URLs from your reports

You could add an extension which excludes these types of URLs from display in the reports. This feels like a bad approach (you still end up tracking those URLs, slowing down the email, and filling your DB with data you don't need - but then hide the data from your report). But it's possible and might be less work than getting a fix into core, so again ... for completeness.

Modify CiviCRM - only track clickable URLs

It seems like CiviCRM is tracking any URL pattern, which suggests civicrm looked for something like /['"]https?://(.*)['"]/ - but could perhaps only be looking for links. You could gather some data on this to file a feature request.

  • Does CiviCRM add link tracking to all URLs in emails, or just some?
  • Does CiviCRM add link tracking to <link href="style.css" rel="http://example.org/style.css"> but not <style type="text/css">@import http://example.org/style.css</style>? (Maybe it's the href= that confuses Civi?)
  • ... ask lots of questions, propose an improvement, consider other use cases, help make it happen!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.