Soo uhh.. How does AnalysticsService Work exactly?

I found out about it while exploring the experience page and it looked cool. I tried making this script to log joins as custom event on there. However, for some reason it does not show on the custom events list… How can I solve this issue??

local AS = game:GetService("AnalyticsService")

game.Players.PlayerAdded:Connect(function(plr: Player)
	AS:LogCustomEvent(plr, "PlayerJoined", 1, {
		message = plr.Name .. " has joined the game."
	})
end)
1 Like

Please help… litteraly nothing works… :sob:

I don’t think you need to make message a variable

Updated Script:

local AS = game:GetService("AnalyticsService")

game.Players.PlayerAdded:Connect(function(plr: Player)
	AS:LogCustomEvent(plr, "PlayerJoined", 1, {plr.Name .. " has joined the game."})
end)

Try that

Trying to do that gives the “Unable to cast to Dictionary” error

You need Enum.AnalyticsCustomFieldKeys for it to work

local AS = game:GetService("AnalyticsService")

game.Players.PlayerAdded:Connect(function(plr: Player)
	AS:LogCustomEvent(plr, "PlayerJoined", 1, {
		[Enum.AnalyticsCustomFieldKeys.CustomField01] = plr.Name .. " has joined the game.",
	})
end)

Passes 0 errors

1 Like

you would have to do something like this, although i have tested it and i cannot get roblox to display the custom event in my experience analytics :confused:

	AnalyticsService:LogCustomEvent(player, "PlayerJoined", 1, {
		[Enum.AnalyticsCustomFieldKeys.CustomField01] = player.Name .. " has joined the game.",
	})
1 Like

Wrong

1 Like

Yes you are correct. Only specific keys provided by Enum.AnalyticsCustomFieldKeys will work so that’s why his was unable to cast to dictionary

1 Like

This worked for me yeah. I wish they explained this properly in the example scripts they gave

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.