Reputation: 1396
im doing a project with windows mobile .net framework
and i need to track every page with google analytics
therefore i create a web browser on every page and hidden it
the web browser will include a local html page
the html page has embed google analytics
however if i use traditional method or async method to integrate GA, it will throw js error with unspecified error, but the html is working if i put it to webserver
therefore i build a GA tracking image url to log the pageview and visitor count, however i found that the cookie can not be save, those every page will generate a new visitor count
any advise
Upvotes: 0
Views: 140
Reputation: 1084
If I understand your question correctly, you are simply trying to add GA tracking to your WP7 app. If that is the case, you do not have to use a web browser or a tracking image to accomplish this. There is a project over on GitHub that will allow you to do this right in your .xaml pages.
https://github.com/maartenba/GoogleAnalyticsTracker
Get the code, compile it and add a reference to the lib in your phone project, then in your xaml code behind:
Loaded += (s, e) => {
using (var tracker = new Tracker("UA-XXXXXXXX-X", "appname")) {
tracker.TrackPageView("MainPage", "Main");
}
};
Put your GA account info in there for the Tracker object
And presto, you have GA tracking.
HTH
Upvotes: 2