1

Windows ストア アプリで Google アナリティクスを使用しようとしていますが、例外が発生します。私はこのことにまったく慣れていません。これを修正するのを手伝ってください。

NuGet パッケージ: GoogleAnalyticsSDK

例外:

 `System.AggregateException was unhandled by user code HResult=-2146233088
  Message=One or more errors occurred.
  Source=mscorlib
  StackTrace:
       at System.Threading.Tasks.Task.ThrowIfExceptional
      (BooleanincludeTaskCanceledExceptions)
       at System.Threading.Tasks.Task.Wait
      (Int32 millisecondsTimeout, CancellationToken cancellationToken)
       at System.Threading.Tasks.Task.Wait()
       at GoogleAnalytics.EasyTracker.InitConfig(Uri configPath)
       at GoogleAnalytics.EasyTracker.SetContext(Application ctx)
       at GoogleAnalytics.EasyTracker.GetTracker()
       at HelloWorld.MainPage..ctor()
       at    HelloWorld.HelloWorld_XamlTypeInfo.XamlTypeInfoProvider.Activate_0_MainPage()
       at HelloWorld.HelloWorld_XamlTypeInfo.XamlUserType.ActivateInstance()
  InnerException: System.Xml.XmlException
       HResult=-2146232000
       Message='Text' is an invalid XmlNodeType. Line 33, position 29.
       Source=System.Xml
       LineNumber=33
       LinePosition=29
       StackTrace:
            at System.Xml.XmlReader.ReadEndElement()
            at GoogleAnalytics.EasyTrackerConfig.LoadConfigXml(XmlReader reader)
            at GoogleAnalytics.EasyTrackerConfig.Load(XmlReader reader)
            at GoogleAnalytics.EasyTracker.InitConfig(XmlReader reader)
            at GoogleAnalytics.EasyTracker.<InitConfig>b__0(Task`1 t)
            at `System.Threading.Tasks.ContinuationTaskFromResultTask1.InnerInvoke()`
               ` at System.Threading.Tasks.Task.Execute()
       InnerException:{"'Text' is an invalid XmlNodeType. Line 33, position 29."}`

これは、分析を使用している C# コードです。メイン ページに 3 つのボタンがあり、アプリが Google 分析プラットフォームを使用して統計を報告しているかどうかを確認しています。

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

namespace HelloWorld
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
            string a = "Main";
             GoogleAnalytics.EasyTracker.GetTracker().SendView(a);

        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            GoogleAnalytics.EasyTracker.GetTracker().SendView("Button1");

        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            GoogleAnalytics.EasyTracker.GetTracker().SendView("Button2");
        }

        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            GoogleAnalytics.EasyTracker.GetTracker().SendView("Button3");
        }
    }
}
4

0 に答える 0