One important note. LocallyGrown only accepts the identifier for these services (the ID number), not the full <script> snippet you might see in their setup instructions. This is a deliberate security choice — letting market managers paste raw JavaScript into a shared platform would create real risks for everyone's shoppers. We'll handle the actual snippet for you; you just give us the ID.

Google Analytics 4

Google Analytics 4 (GA4) is Google's current analytics product. If you set up Google Analytics any time after July 2023, you almost certainly have GA4. (The older "Universal Analytics" — IDs starting with UA- — was discontinued in 2023 and no longer collects data, even if you still have the ID saved.)

Find your Measurement ID

  1. Sign in to Google Analytics.
  2. Click the gear icon ("Admin") at the bottom-left.
  3. Under Property, click Data Streams.
  4. Click your web data stream (or create one for your market subdomain).
  5. Copy the Measurement ID — it starts with G- followed by letters and numbers.

Add it to your market

  1. Open your market settings → Domain Information.
  2. Paste your ID into Google Analytics 4 Measurement ID. Just the ID itself — not the surrounding <script> tag.
  3. Save.

Tracking will start on the next page load. Data takes a few hours to show up in GA4's reports — that's a Google thing, not us.

What about Google Tag Manager? We don't currently support GTM container IDs (the ones that start with GTM-) — only direct GA4 IDs. If you rely on GTM, let us know and we'll look at adding it.

Meta Pixel (Facebook & Instagram)

The Meta Pixel lets you run targeted ads on Facebook and Instagram to people who've visited your market, and measure how many of those visitors actually placed an order. If you're not running Meta ads, you don't need this.

Find your Pixel ID

  1. Sign in to Meta Events Manager.
  2. If you don't already have a Pixel, click Connect data sourcesWebMeta Pixel and follow the setup. You can skip any step that asks you to install the code yourself.
  3. Once you have a Pixel, your Pixel ID is the number shown at the top of its page — usually 15 or 16 digits long.

Add it to your market

  1. Open your market settings → Domain Information.
  2. Paste the numeric ID into Meta (Facebook) Pixel ID. Just the digits — not the surrounding <script> code Meta shows you.
  3. Save.

Meta will start receiving page-view events from your market. You can verify it's working in Events Manager → Test Events, or by installing Meta's Pixel Helper Chrome extension and loading your market.

Why we don't accept raw <script> snippets

Both Google and Meta show you a <script> tag during setup and tell you to "paste this in your site's header." That works fine when you own your own website — but LocallyGrown is a shared platform serving many markets, growers, and shoppers from the same codebase. Letting anyone paste arbitrary JavaScript into a page would mean:

  • A compromised market-manager account could hijack shoppers' logins or payment details.
  • A copy-paste typo could break checkout or the cart for every customer at the market.
  • Other markets' code would have to be reviewed against unknown third-party scripts on the same shared infrastructure.

By accepting only the ID and rendering the snippet on our side, we get the same outcome — Google and Meta start collecting data — without any of those risks. If your marketing vendor or consultant is comfortable with GA4 and Meta Pixel, they'll recognize the IDs immediately. If they push back, point them here.

Other tracking tools

Right now we support Google Analytics 4 and the Meta Pixel — the two we get asked about most. If you'd like us to support another tracker (Plausible, Pinterest Tag, TikTok Pixel, etc.), reply to any email from us with the details and we'll take a look.

Related