Mailchimp landing page GA4 tracking example

Hello world. Is this from Mailchimp?

Your Mailchimp Email UID is not set

You can send Mailchimp Email UIDs in email shots by using the *|EMAIL_UID|* merge tag in a link URL.

The URL used for this example was:

https://davidsimpson.me/labs/pii-viewer/mailchimp-example.html?mcid=*|EMAIL_UID|*

If your Mailchimp Email UID is set, then it will be sent over to Google Analytics (GA4) by this page using the following code:

const mcid = new URLSearchParams(location.search).get('mcid');
if (mcid) {
  gtag("event", "mailchimp_mailshot", {
    mcid: mcid,
  });
} 

Edit this file on GitHub