public void TestAnalyticsModel()
        {
            RequestSettings settings = new RequestSettings("Unittests", this.userName, this.passWord);

            AnalyticsRequest request = new AnalyticsRequest(settings);

            Feed <Account> accounts = request.GetAccounts();

            foreach (Account a in accounts.Entries)
            {
                Assert.IsNotNull(a.AccountId);
                Assert.IsNotNull(a.ProfileId);
                Assert.IsNotNull(a.WebPropertyId);
                if (this.accountId == null)
                {
                    this.accountId = a.TableId;
                }
            }


            DataQuery q = new DataQuery(this.accountId, DateTime.Now.AddDays(-14), DateTime.Now.AddDays(-2), "ga:pageviews", "ga:pageTitle", "ga:pageviews");


            Dataset set = request.Get(q);

            foreach (Data d in set.Entries)
            {
                Assert.IsNotNull(d.Id);
                Assert.IsNotNull(d.Metrics);
                Assert.IsNotNull(d.Dimensions);
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            var email = inputReader.GetInput("Enter your email: ");
            var password = inputReader.GetPassword("Your Password: "******"linq2ga", email, password);
            var request = new AnalyticsRequest(settings);

            messenger.Send("Please wait. Loading your Accounts... ");
            var accounts = request.GetAccounts();
            foreach (var account in accounts.Entries)
                messenger.Send(account.AccountName);

            inputReader.GetInput("... press enter to continue ...");
        }
        public void TestAnalyticsModel()
        {
            RequestSettings settings = new RequestSettings("Unittests", this.userName, this.passWord);

            AnalyticsRequest request = new AnalyticsRequest(settings);

            Feed<Account> accounts = request.GetAccounts();

            foreach (Account a in accounts.Entries)
            {
                Assert.IsNotNull(a.AccountId);
                Assert.IsNotNull(a.ProfileId);
                Assert.IsNotNull(a.WebPropertyId);
                if (this.accountId == null)
                    this.accountId = a.TableId;
            }
            

            DataQuery q = new DataQuery(this.accountId, DateTime.Now.AddDays(-14), DateTime.Now.AddDays(-2), "ga:pageviews", "ga:pageTitle", "ga:pageviews");


            Dataset set = request.Get(q);

            foreach (Data d in set.Entries)
            {
                Assert.IsNotNull(d.Id);
                Assert.IsNotNull(d.Metrics);
                Assert.IsNotNull(d.Dimensions);
            }
        }