Exemplo n.º 1
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            // Audience Insight config

            var batchingConfig = await BatchingConfigFactory.Load(new Uri("ms-appx:///AudienceInsightConfig.xml"));

            var dataClient = (RESTDataClient)batchingConfig.BatchAgent;

            dataClient.AdditionalHttpHeaders.Add("Authorization-Token", "{2842C782-562E-4250-A1A2-F66D55B5EA15}");

            batchingLogAgent = new BatchingLogAgent(batchingConfig);
        }
Exemplo n.º 2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            // Audience Insight config

            var batchingConfig = BatchingConfigFactory.Load(new Uri("/StandaloneSample;component/AudienceInsightConfig.xml", UriKind.Relative));

            var dataClient = (RESTDataClient)batchingConfig.BatchAgent;

            dataClient.AdditionalHttpHeaders.Add("Authorization-Token", "{2842C782-562E-4250-A1A2-F66D55B5EA15}");

            batchingLogAgent = new Microsoft.AudienceInsight.BatchingLogAgent(batchingConfig);

            base.OnNavigatedTo(e);
        }
Exemplo n.º 3
0
        async void player_Loaded(object sender, RoutedEventArgs e)
        {
            var configFileUrl = new Uri("ms-appx:///AudienceInsightConfig.xml");

            // Audience Insight config

            var batchingConfig = await BatchingConfigFactory.Load(configFileUrl);

            var dataClient = (RESTDataClient)batchingConfig.BatchAgent;

            dataClient.AdditionalHttpHeaders.Add("Authorization-Token", "{2842C782-562E-4250-A1A2-F66D55B5EA15}");

            var batchinglogAgent = new BatchingLogAgent(batchingConfig);
            var aiLoggingTarget  = new AudienceInsightLoggingTarget(batchinglogAgent);

            Microsoft.Media.Analytics.LoggingService.Current.LoggingTargets.Add(aiLoggingTarget);

            // Player Framework analytics config

            var analyticsConfig = await AnalyticsConfig.Load(configFileUrl);

            var analyticsPlugin = new AnalyticsPlugin(analyticsConfig);

            var adaptivePlugin         = player.Plugins.OfType <AdaptivePlugin>().FirstOrDefault();
            var adaptiveMonitorFactory = new AdaptiveMonitorFactory(adaptivePlugin.Manager);

            var edgeServerMonitor = new EdgeServerMonitor();

            analyticsPlugin.AdaptiveMonitor   = adaptiveMonitorFactory.AdaptiveMonitor;
            analyticsPlugin.EdgeServerMonitor = edgeServerMonitor;

            player.Plugins.Add(analyticsPlugin);

            // Audience Insight ad tracking config

            analyticsPlugin.AnalyticsCollector.LoggingSources.Add(new AdvertisingLoggingSource(player.GetAdHandlerPlugin().AdHandlerController));

            // -or-

            //LoggingService.Current.LoggingSources.Add(new AdvertisingLoggingSource(player.GetAdHandlerPlugin().AdHandlerController));
        }