blazor-analytics icon indicating copy to clipboard operation
blazor-analytics copied to clipboard

Use package from API

Open matteomigliore opened this issue 3 years ago • 8 comments

Hi,

how is possible to use the package from API in ASP.NET Core?

Is also possible to track a single user passing any ID?

Thank you.

matteomigliore avatar Dec 15 '21 12:12 matteomigliore

I suppose you can inject the IAnalytics interface in your controller and use it

CrahunGit avatar Dec 15 '21 12:12 CrahunGit

Please, can you give me a more specific example?

Thank you.

On Wed, Dec 15, 2021 at 1:15 PM Tomás López Rodríguez < @.***> wrote:

I suppose you can inject the IAnalytics interface in your controller and use it

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/isc30/blazor-analytics/issues/49#issuecomment-994734915, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADJWTSPGX4WVSMPHCO2W2DURCBFJANCNFSM5KDPBKVA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

matteomigliore avatar Dec 15 '21 12:12 matteomigliore

you can inject IAnalytics GlobalTracking with constructor injection in any class you want and then you can call TrackEvent with the data you need. It's not different from blazor where the @inject is injected on property on the generated class. You can read further on the readme

CrahunGit avatar Dec 15 '21 12:12 CrahunGit

Is possible to use the measurement ID?

And is possible to track single users?

matteomigliore avatar Dec 15 '21 15:12 matteomigliore

@CrahunGit should you add tracking of user sessions passing a user ID string?

Like explained here: https://phppot.com/php/track-individual-logged-in-users-using-google-analytics

Thank you

matteomigliore avatar Dec 17 '21 19:12 matteomigliore

Well. It does not seem hard at first but It takes few steps on the google manager before it before you can log user’s actions.

As you can read this is working on google analytics but not in ga.

On the blazor side its just a matter of calling the apropiated Javascript. Nothing else.

We need time to see if it can be done right now or it needs some design first.

CrahunGit avatar Dec 17 '21 19:12 CrahunGit

Great, thank you. Should be really appreciated.

P.S. I'm near Alicante too.

matteomigliore avatar Dec 17 '21 19:12 matteomigliore

We’re neighbors. All Spanish developers trying its best writing bad English. Awesome.

CrahunGit avatar Dec 17 '21 19:12 CrahunGit