Guide 147 · Events · GA4 + Tag Manager
Track logins with the recommended login event: method, the GA4 Event tag, and the check in DebugView
A login is one of the events Google names as recommended for every property, and it only works as a report if it is sent under the exact name login with the method parameter. This guide builds it as a GA4 Event tag in Tag Manager: the tag fires on the login confirmation, carries method as Google or email, and the check runs in DebugView before anything is published.
After the tag is published, a test login shows in DebugView as a login event with method set to Google or email, and the Realtime report lists it under Event count by Event name within minutes.
Download the container fragment: the login event container fragment (JSON) (2286 bytes, MD5 5913f0f3a178df7a79e468d3ef2ac508). It holds one GA4 Event tag named GA4 - login, the Custom Event trigger that fires when the data layer event equals login, and the data layer variable for method. 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. The setup guide installs it on the Initialization trigger; this guide adds one event tag beside it.
- A login confirmation your site can signal. The data layer push below runs on the login confirmation page or the login success callback, not on the login form itself.
- The method your visitor used. Google's prescribed parameter for
loginismethod: the value is the sign-in method, such asGoogleoremail.
The worked example
The test below is three logins in one session, two with Google and one with email. The method split is the figure that matters: it is what the tag carries, and what the report later shows.
| Login | Method |
|---|---|
| First login | |
| Second login | |
| Third login | |
| Total logins | 3 |
| Google share | 2 of 3 (66.67%) |
That split was recomputed here before publication: 2 divided by 3 is 0.6667, so Google accounts for 66.67% of the three logins, and email for 33.33%. The data layer push that carries one of those logins is the standard form:
dataLayer.push({
event: "login",
method: "Google"
});
The trace
- Push the login to the data layer. When the login succeeds, run
dataLayer.push({ event: "login", method: "Google" }), with the method value set to the method actually used. The event name islogin, exactly as Google spells it, and the parameter name ismethod. A push on the login form, before the sign-in succeeds, counts attempts, not logins. - Create the data layer variable. In Tag Manager, go to Variables, then in User-Defined Variables click New, choose Data Layer Variable, set the Data Layer Variable Name to
method, and name the variableDLV - method. The tag reads the method from this variable, so the name must match the key in the push. - Add the GA4 Event tag. Go to Tags, then click New. Name it
GA4 - login. In Tag Configuration, choose tag type Google Analytics: GA4 Event. Enter your Measurement ID. In Event Name, enterlogin. Under Event Parameters, add a row with Parameter Namemethodand Value{{DLV - method}}. Do not add a page_view parameter: the Google tag already sends page_view, and a second one doubles it. - Set the trigger. In Triggering, click the trigger box and choose New, then choose trigger type Custom Event. Set Event Name to
loginand choose All Custom Events. Click Save, then Save the tag. The trigger watches the data layer event name, which is why the push in step 1 and the trigger in this step must spell it the same way. - Check it in Preview and DebugView. Click Preview, enter the site URL, and click Connect. Log in on the site with Google. In Tag Assistant, the
loginevent must appear in the left panel with the tag under Tags Fired. Then open DebugView in Analytics (Admin, then Data display, then DebugView) and confirm theloginevent shows with themethodparameter set toGoogle. - Publish it as a version. Click Submit at the top right, select Publish and Create Version, name the version, and click Publish. Visitors get the new tag only after this step; Preview tests a draft that nobody else sees.
Dead ends
DEAD END — LOGIN WITH A CAPITAL L IS A DIFFERENT EVENT. GA4 event names are case-sensitive. A data layer event named Login never matches a trigger waiting for login, and if it arrives anywhere it reports as a separate event. Use the recommended name exactly as written.
DEAD END — THE TAG FIRES ON THE FORM, NOT THE SUCCESS. A trigger on a login button click counts everyone who tried, including everyone whose password failed. The push belongs on the success callback or the confirmation page, where the sign-in is real.
DEAD END — METHOD AS A FREE-TEXT STRING. If the method value is typed differently each time — Google, google, Google Sign-In — the report splits one method into three rows. Pick one spelling per method and use it everywhere.
End state
One tag, one trigger, one parameter. A login 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 method split visible per row. From here the same pattern covers sign_up: same tag type, same trigger type, a different event name and the same method parameter.
Sources
- Analytics Help — [GA4] Recommended events — login is a recommended event for all properties; it is sent when a user logs in
- Google Analytics developer documentation — GA4 event reference — the login event and its prescribed parameter, method
- Tag Manager Help — Set up Google Analytics events in Tag Manager — the GA4 Event tag, the Measurement ID, the event name, the trigger, and Preview verification
- Analytics Help — Monitor events in DebugView — Admin, then Data display, then DebugView; the Seconds stream covers 60 seconds and the Minutes stream 30 minutes
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 the {{DLV - method}} reference exists as a variable — and the method split was recomputed: 2 of 3 logins by Google is 66.67%, 1 of 3 by email is 33.33%. Google moves menu items without warning; if a path on this page no longer matches, the linked help page is the current map.