Coder Social home page Coder Social logo

Comments (9)

Stefan-deHoDev avatar Stefan-deHoDev commented on July 19, 2024

I'm having the same problem. It seems that this does not work when the google analytics property is set to "app".
Although the description linked in the readme tells us to create an "app" analytics property.
(I didn't test any other google analytics properties)

I have had the same issue with every other google analytics framework/project. None seem to work with an "app" analytics property.

PS: I used the sample project included in the download to test this, with the only change being replacing the property id with mine. I tested it last week and the property was created a week before the test, so it can't be a delay problem

from csharpanalytics.

kpantos avatar kpantos commented on July 19, 2024

You're right. I've changed my property type from "app" to "Website" and it now works.
From what I've been reading the "app" property works with posting xml (at least in android sdk) and not by get requests to dummy images in the google analytics engine.

from csharpanalytics.

damieng avatar damieng commented on July 19, 2024

Yes, sorry this is a known issue I should go and put in the README.

All the reverse-engineering I could do/find online was around the web site parameters.

Google have a new Measurement Protocol that is fully documented including for apps but that's currently in closed beta.

In the mean time we can either use websites or try and reverse engineer the Android/iOS calls.

from csharpanalytics.

damieng avatar damieng commented on July 19, 2024

I just setup an Android VM and added some simple tracking from Google's latest API. It looks like they are already using the Measurement Protocol in these SDK's even though there is no mention about signing up for the closed beta. It's possible it's beta only for web sites.

I'll take a look at adding support for the new Measurement API in the next few days.

from csharpanalytics.

Stefan-deHoDev avatar Stefan-deHoDev commented on July 19, 2024

You're right. I have 2 google analytics app properties. One was accepted for the closed beta, the other is a normal app property not in the Measurement Protocol beta.
However I can use the Measurement Protocol for both without problem and it works great, real-time data with maybe 5 seconds delay.
This is the code I used (just replace the xxxxxx with your app property id and you'll get live data)

String payload = "v=1&tid=xxxxxxxxxxxx&cid=1234&t=appview&an=protocoltest&av=0.0.0.1&cd=PostNormalProp";
HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Add("user-agent", "Mozilla/5.0 (PC; en-us) Windows 8 (KHTML) App");
Print("UserAgent: " + client.DefaultRequestHeaders.UserAgent.ToString());
var get = await client.PostAsync(url, getcontent(payload));
Print("Result Post Normal: " + await get.Content.ReadAsStringAsync());

Edit:
Note that the user agent does not seem to be in the correct format to report device type/data and os version. Should any of you find the right format to report these, I would appreciate a comment

from csharpanalytics.

damieng avatar damieng commented on July 19, 2024

Hmm, so it looks like they're putting a handful of the new protocol parameters onto the old UTM tracker. That's easy to add. I have some code to access device manuf and version but I don't think that should go in the user agent. Getting the OS version would require a WinRT component.

from csharpanalytics.

Stefan-deHoDev avatar Stefan-deHoDev commented on July 19, 2024

I was not asking for something like that. However Google Analytics has device models, os version and so on integrated and I would like to use it (and I guess others would too). I personally would just give the user the option to set all those parameters before they start tracking.

Google Analytics uses the user-agent to get browser, browser version, platform and platform version for websites. Since there is no other way to report these things for apps, I think it's used for device model etc. in app properties.

From the reference:

user_agent_string – Is a formatted user agent string that is used to compute the following dimensions: browser, platform, and mobile capabilities.
If this value is not set, the data above will not be computed.

The last sentence is not 100% true. In my tests my "appviews" were being computed even with no user-agent set.

from csharpanalytics.

damieng avatar damieng commented on July 19, 2024

Basic measurement protocol support is now in the measurement-protocol branch and it is recording real-time against application types. Need to add tests before I merge it back into master.

from csharpanalytics.

damieng avatar damieng commented on July 19, 2024

Measurement Protocol support appears to be working and is available for testing. Use the AutoMeasurement class instead of AutoAnalytics as a starting point.

from csharpanalytics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.