You should be using gtag.js to send GA events, since that's your method of implementation of GA, not ga() as that's for analytics.js.
The pattern to send an event is:
gtag('event', <action>, {
'event_category': <category>,
'event_label': <label>,
'value': <value>
});
Updated snippet:
$http({enter code here
method: 'POST',
'async': true,
'cache': false,
'global': false,
url: //the correct url,
isStaySignIn: isStaySignIn,
isIdamOn: true,
}).success(function(data, status, headers) {
$rootScope.Loading = "Loading";
deferred.resolve({
data: data,
headers: headers
});
//send login event using gtag.js
gtag('event', 'IDAM', {
'event_category': 'MODE',
'event_label':'Login using Jio ID',
});
})
Answer from XTOTHEL on Stack OverflowVideos
Using Google Tag Manager to Send Conversion Event to Google Ads?
I have a Custom HTML Tag configured in GTM that listens for a JavaScript event for the contact form being submitted. It then sends calls window.dataLayer.push and sends the Google Analytics event. I need to also send this conversion to Google Ads. Can I use the following or something similar to it?
window.dataLayer.push({
"event" : "conversion",
"send_to": "AW-33************"
})
Or if not what would I pass to the push function to send the conversion to Google Ads?
Thanks,
John
This is driving me crazy - I have google ads connected to my GA4. I have set up conversions in Google ads using manual tracking through tag manager and for form submissions I have used Submit Lead Form conversion. The set up is correct in terms of tag and trigger in tag manager. However when I test out this form submission in tag assistant - it doesn’t show any hits for the form submission event being fired but it shows hits for a purchase event (with my form tag name). I’m very confused - am I missing something?
Hello everyone,
I'm curious about something regarding tracking and would like some advice to ensure I am understanding it correctly.
Usually, I create events and conversions in GTM using the Gtag. However, for reporting and tracking purposes, I also need the event results to be counted and shown in GA4. To achieve this, I also create the same event using the GA4 Event tag.
So in the end, for each event, I have both a Google Tag and a GA4 Event tag. I am confused if this is the correct way to do it.
Correct me if I'm wrong, but I remember that if you only use the Gtag for an event, it will not be tracked in GA4. This is why I have been doing it this way, but please let me know the correct method. Thank you