Improved Google Analytics Module

I finished my additions on the original Google Analytics Module! :swag:

Four primary labels are used:

Ignore the version 0; that was a client bug that I fixed recently :stuck_out_tongue:

Tada! I used a separate event label for “Play Time Statistics” and got this:

MainModule on Pastebin
GoogleAnalyticsHelper on Pastebin

Roblox Model of Module

To use the module, put this code in a server script:

if( game.PlaceId > 0 )then local GA = require(game:GetService("InsertService"):LoadAsset(171763666).MainModule) GA.Init("UA--------") --Your unique ID print("Analytics Fired") end

You need to put the model on-sale for it to work, btw.

No, you don’t :smiley:

I don’t get how to use it, as there’s no place to put the Google ID?

Roblox’s own uses this to get the model.

local GA = require(game:GetService(“InsertService”):LoadAsset(153590792).MainModule)
GA.Init("UA-IDS)

  1. There is an issue with it showing client errors. So keep that in mind. I will fix it ASAP.
  2. If you use Roblox’s code to get the module and just change the asset id, it will work. I’ll add that to it soon as well.

Sorry guys… :frowning:

No, you don’t :D[/quote]

Uh, yeah? We can’t insert something if the asset isn’t for sale.

For those asking, for any ModuleScript model that’s closed-source,

require(idHere) --> works if on live server, no matter if it's open or not

Uh… that sounds a little problematic? Can’t you steal the source code of any script by doing that?

No?

The problem with that, is someone could easily insert a admin module and not knowing that?

No. It doesn’t create any sort of object, so even with super-1337-uber-h4x to get an identity able to read Source, you can’t steal it. The way you’d have to go about that is by watching (what I’m guessing is) HTTP traffic to get the module, and then read the response. How do you do that? You don’t.

Very cool Nick :slight_smile:

This happend when i tried it.

External Media

I get this error, when trying to use it.

External Media

[quote] I get this error, when trying to use it.

External Media

[/quote]

Weird. I made the module free to use; maybe that will fix it.

Keep in mind that you can only require non-public modules from server scripts, which means it won’t work in Play Solo since everything is local.

Echo, i tried in a online server, using F9 i found that error, but let’s test now. [Edit, it works now]

I’m glad it works now!

I’m open to any suggestions :smiley:

Does httpservice add onto the throttling limits of site services like marketplaceservice checking and datastores?

[quote] You can’t use require to grab an uploaded module on the client…?

In any case that you do want to use a module and keep the source secure, here’s some nifty information.

I know that Seranok was having people try to steal the source of a module that he uploaded. From what I remember, the module must meet the following criteria to be secure:
[ul]
[li]Upload the module on an account with no active places
[ul]
[li]Prevents an exploiter from using LoadAsset on your ModuleScript to get it’s source.[/li]
[/ul]
[/li]
[li]Destroy the module the first chance you can.
[ul]
[li]Someone can insert the module (which defaults to parent to the Workspace iirc), then save the place (using the SavePlace method) and they have the source.[/li]
[li]Call the Destroy method on your module.[/li]
[/ul]
[/li]
[li]There cannot be a reference to the module instance.
[ul]
[li]You can use getfenv on the result, therefore you can reparent (or clone and reparent) the module to the workspace and save from there.[/li]
[li]Set script to nil at the top of your module and the resulting fenv has no reference to the module instance.[/li]
[/ul]
[/li]
[li]Wrap the functions so string.dump doesn’t provide sensitive information.[/li]
[/ul]

Source: Challenge: Steal the source of a copylocked ModuleScript (Page 2) [/quote]

I don’t believe it does. I could be wrong, but in that case that would be a horrible inconvenience.