Directory / plugin
Mailster Google Analytics
v1.5.0 · by EverPress
Add Google Analytics UTM parameters to Mailster newsletter links and track the web version in GA4.
About this plugin
Mailster Google Analytics adds Google Analytics campaign parameters to links in the Mailster Newsletter Plugin for WordPress, and can record a page view of each newsletter’s public web version.
Use it when you send Mailster campaigns and want those clicks to show up in Google Analytics as email traffic, with a source, medium, and campaign name, instead of as direct visits.
This plugin requires Mailster. It does not include a Google Analytics account or connect to Google with an API key. When you save a Measurement ID, the newsletter web version loads Google’s tag. UTM parameters are added to link URLs. The plugin does not upload your subscriber list to Google.
UTM parameters on newsletter links
- Campaign parameters — Adds
utm_source,utm_medium,utm_term,utm_content, andutm_campaigntohttpandhttpslinks. Values are URL-encoded. - Defaults — On first activation, if these options are not saved yet, source is
newsletter, medium isemail, term is%%LINK%%, content is empty, and campaign is%%CAMP_TITLE%%. - Merge tags — You can use
%%CAMP_ID%%,%%CAMP_TITLE%%,%%CAMP_TYPE%%,%%CAMP_LINK%%,%%SUBSCRIBER_ID%%,%%SUBSCRIBER_EMAIL%%,%%SUBSCRIBER_HASH%%, and%%LINK%%. The settings screen has copy buttons for these except%%SUBSCRIBER_ID%%, which the plugin still replaces when you type it in. - Mailster click tracking — When the campaign tracks clicks, Mailster’s redirect adds the parameters after the click. When click tracking is off, the parameters are written into the link in the email.
- External domains — When this option is off, only links on this site’s domain are tagged. On first activation the option allows external domains.
- Per campaign — Turn on campaign-based values to show a Google Analytics box in the campaign editor. Finished and active campaigns keep those fields locked, as does an autoresponder while you view its statistics.
Newsletter web version
On Newsletter Settings Google Analytics:
- G-Tag ID — GA4 Measurement ID, such as
G-XXXXXXXXXX. Loadsgtag.json the public newsletter page. - Web Property ID (legacy) — Older
UA-XXXXXXX-XID. Loads the legacyga.jssnippet. Use a GA4 Measurement ID for current Google Analytics reporting. - SetDomainName — Optional cookie domain. Legacy tracking passes it to
_setDomainName. GA4 passes it ascookie_domain.
That snippet runs in the newsletter web version only. It does not load Google’s tag on every page of the site.
How to set it up
- Install and activate Mailster, then activate Mailster Google Analytics.
- In Google Analytics, copy the GA4 Measurement ID for the property that should receive the hits.
- Open Newsletter Settings Google Analytics, paste the Measurement ID, review the default UTM values, and save.
- Enable campaign-based values if a campaign needs its own source, medium, term, content, or name.
- Send a test campaign and open a tracked link. When the destination site uses that Google Analytics property, the visit can be reported under Acquisition Traffic acquisition. See Google’s URL builder guide.
Setup notes: Track your clicks with Google Analytics.