问题
I have googling around for a day and found no proper solution to apply google analytics for smart tv app. I have tried these links but had no luck to crack the issue.
Google Analytics and Samsung Smart TV Apps
I dont want an iframe solution since it can be only used for pageviews not events. Currently iam working on 2011 and 2013 Tv and document.domain gives me "localhost" in 2011 and "" for 2013.
Is there any proper way to implement google analytics without using iframe ?
Thanks in advance.
回答1:
Okay thanks to @DamTo for a chat discussion that solved me my day. Manually sending GET/POST request depending on the payload to google url end-point registered my page view on Google analytics admin panel.
Here is the reference for sending manual request.
https://developers.google.com/analytics/devguides/collection/protocol/v1/reference
Since smart tv doesnt support cookie storage, the client id has to be stored in filesystem to save and produce unique event/page requests.
回答2:
If the smart TV supports Android and many do, then it is a simple matter of using the Google Analytics API from Google Play Services within your Android app.
来源:https://stackoverflow.com/questions/24177264/google-analytics-for-samsung-smart-tv-app