Skip to content

Guide 151 · Events · GA4 + Tag Manager

Track shares with the recommended share event: method, content_type, item_id, and the GA4 Event tag

Checked 11 November 2026 · Verification: container fragment validated structurally (format 2, unique IDs, trigger resolves, variable references exist); worked example recomputed · Steps traced to Analytics Help and Tag Manager Help, opened 11 November 2026 · 6-minute read

A share button that does nothing in GA4 is a dead end: the site never learns which content travels or which channel carries it. The share event is a recommended event for every property, with three prescribed parameters — method, content_type, and item_id — and this guide builds it as a GA4 Event tag that fires on the share action.

Expected signal

After the tag is published, a test share shows in DebugView as a share event with method, content_type, and item_id all set, and the Realtime report lists it under Event count by Event name within minutes.

Download the container fragment: the share event container fragment (JSON) (3998 bytes, MD5 73931e30d5d8aa3fd9f022d191aa1be3). It holds one GA4 Event tag named GA4 - share, the Custom Event trigger that fires when the data layer event equals share, and the three data layer variables for method, content_type, and item_id. The Measurement ID is left as G-XXXXXXXXXX for you to replace. Import it from Admin, then Import Container, choosing Merge if the container already has tags.

What you need

  • The Google tag already installed through Tag Manager. This guide adds one event tag beside it.
  • A share action your site can signal. The push runs when the visitor completes the share — the share dialog opens or the link is copied — not when the button is merely shown.
  • Three values per share. Google's prescribed parameters for share are method (the channel, such as Facebook or Copy link), content_type (the kind of content, such as article), and item_id (the identifier of the content shared).

The worked example

The test below is six shares of one article across three channels. The number that decides which channel works is the split: half the shares went through copy link.

Channel (method)Shares
Copy link3
Facebook2
Email1
Total shares6
Copy link share3 of 6 (50.00%)

Those figures were recomputed here before publication: 3 plus 2 plus 1 is 6 shares; 3 divided by 6 is 0.5, so copy link is 50.00% of the shares. The data layer push that carries one of those shares is the standard form:

dataLayer.push({
  event: "share",
  method: "Copy link",
  content_type: "article",
  item_id: "guide-0142"
});

The trace

  1. Push the share to the data layer on the action. When the share completes, run dataLayer.push({ event: "share", method: "Copy link", content_type: "article", item_id: "guide-0142" }), with each value set to the real one. The event name is share, exactly as Google spells it, and the parameter names are method, content_type, and item_id.
  2. Create the three data layer variables. In Tag Manager, go to Variables, then in User-Defined Variables create one Data Layer Variable per parameter: DLV - method for method, DLV - content_type for content_type, and DLV - item_id for item_id. If the login or sign_up guide already created DLV - method, reuse it; do not create a second one with the same name.
  3. Add the GA4 Event tag. Go to Tags, then click New. Name it GA4 - share. In Tag Configuration, choose tag type Google Analytics: GA4 Event. Enter your Measurement ID. In Event Name, enter share. Under Event Parameters, add three rows: method with {{DLV - method}}, content_type with {{DLV - content_type}}, and item_id with {{DLV - item_id}}.
  4. Set the trigger. In Triggering, click the trigger box and choose New, then choose trigger type Custom Event. Set Event Name to share and choose All Custom Events. Click Save, then Save the tag.
  5. Check it in Preview and DebugView. Click Preview, enter the site URL, and click Connect. Share the article with copy link. In Tag Assistant, the share event must appear in the left panel with the tag under Tags Fired. Then open DebugView (Admin, then Data display, then DebugView) and confirm the share event shows with all three parameters set.
  6. Publish it as a version. Click Submit at the top right, select Publish and Create Version, name the version, and click Publish.

Dead ends

DEAD END — THE TAG FIRES WHEN THE BUTTON IS SHOWN. A trigger on the share button appearing counts every page view as a share. The push belongs on the completed action: the dialog opened, the link copied, the channel chosen.

DEAD END — METHOD TYPED DIFFERENTLY EACH TIME. Copy link, copy_link, and Copy Link are three rows in the report for one channel. Pick one spelling per channel and use it everywhere; the same rule holds for content_type.

DEAD END — ITEM_ID IS THE PAGE TITLE. Titles change when a page is edited, and a changed title splits one article's shares across two rows. The item_id is a stable identifier — the article slug or the database ID — that survives an edit.

End state

One tag, one trigger, three parameters. A share shows in DebugView within a minute of the test, in Realtime within minutes of publishing, and in the Events report within 24 hours, with the channel split visible per row and the content split visible per item_id. Register item_id as an event-scoped custom dimension if you want to break the Events report down by article — the custom dimensions guide covers that step.

Sources

Checked 11 November 2026. The click paths above are the ones in Google's help and developer pages, opened 11 November 2026. No step in this guide was run inside a live Analytics property or a live Tag Manager container, because both need a Google sign-in and this site does not sign in as anyone. What was run: the container fragment was validated structurally in Python 3.12.3 — export format version 2, unique IDs, the tag's firing trigger resolves to the Custom Event trigger in the file, and all three data layer variable references exist as variables — and the worked example was recomputed: 3 + 2 + 1 = 6 shares; 3 / 6 = 50.00% by copy link. Google moves menu items without warning; if a path on this page no longer matches, the linked help page is the current map.