I have a problem with GA4 and GTM, which i cant solve already for 3 days :(
I created a GA4 tag and event, called it "login". It has a parameter "method" which default value is "00000000000000000000". i need to call this event and set "method" value to my custom (for example, "ZZZZZZZZZZZZZZZZZZZZ" - it will always be random). Here is javascript code, which calls my event:
window.dataLayer = window.dataLayer || [];
var x = null;
x=window.dataLayer.push('js',new Date());console.log('js '+x);
x=window.dataLayer.push('config','G-*******');console.log('config '+x);
x=window.dataLayer.push('set','login',{'method':'ZZZZZZZZZZZZZZZZZZZZ'});console.log('set '+x);
x=window.dataLayer.push({'event':'login','method':'ZZZZZZZZZZZZZZZZZZZZ'});console.log('event '+x);
here is the result:
js false
config true
set true
event false
only the default value of "00000000000000000000" is sent to the server instead of "ZZZZZZZZZZZZZZZZZZZZ". always! when calling an event, a request always send default value of "method" parameter. i don't understand why
GET /g/collect?v=2&tid=G-*******'>m=45je48r0v9193929697z89192937461za200&_p=1724944900794&gcd=13l3l3l3l1l1&npa=0&dma=0&tag_exp=0&cid=476783039.1711069035&ul=ru-ru&sr=2560x1440&uaa=x86&uab=64&uafvl=Not)A%253BBrand%3B99.0.0.0%7CGoogle% 2520Chrome%3B127.0.6533.120%7CChromium%3B127.0.6533.120&uamb=0&uam=&uap=Windows&uapv=15.0.0&uaw=0&are=1&pae=1&frm=0&pscdl=label_only_1&_s=3&sid=17249 42914&sct=18&seg=1&dl=https%3A%2F%2Fmyweb.com%2F&dt=Search&en=login&_c=1&ep.method=00000000000000000000&_et=2&tfd=3996
here is dataLayer content from DebugView:
{
0: "l",
1: "o",
2: "g",
3: "i",
4: "n",
5: "T",
6: "S",
7: "Y",
8: "V",
9: "T",
10: "L",
11: "H",
originalLocation: "https://myweb.com/index.html?" +
"gtm_debug=1724949731136",
event: "login",
gtm: {
uniqueEventId: 47,
start: 1724949732880,
allowlist: undefined,
blocklist: undefined,
whitelist: undefined,
blacklist: undefined,
scrollThreshold: 90,
scrollUnits: "percent",
scrollDirection: "vertical",
triggers: "17",
priorityId: 8
},
tagTypeBlacklist: undefined,
propertyName: "x",
method: "ZZZZZZZZZZZZZZZZZZZZ"
}
help, whats the problem? i'am newbie to GTM/GA4.