コード例 #1
0
        public SourceTime(DataEntry gaDataEntry, Site site)
        {
            gaAccount = site.account;

            foreach (Dimension dimension in gaDataEntry.Dimensions)
            {
                switch (dimension.Name)
                {
                    case "ga:source": source = dimension.Value;
                        break;
                    case "ga:medium": medium = dimension.Value;
                        break;
                    case "ga:keyword": keyword = dimension.Value;
                        break;
                    case "ga:campaign": campaign = dimension.Value;
                        break;
                    case "ga:daysToTransaction": daysToTransaction = Convert.ToInt32(dimension.Value);
                        break;
                    case "ga:visitsToTransaction": visitsToTransaction = Convert.ToInt32(dimension.Value);
                        break;
                    case "ga:transactionId": orderNumber = dimension.Value;
                        break;
                }
            }
        }
コード例 #2
0
        public DetailedVisit(DataEntry gaDataEntry, Site site)
        {
            gaAccount = site.account;

            foreach (Dimension dimension in gaDataEntry.Dimensions)
            {
                switch (dimension.Name)
                {
                    case "ga:date": gaDate = DateTime.ParseExact(dimension.Value, "yyyyMMdd", null);
                        break;
                    case "ga:medium": medium = dimension.Value;
                        break;
                }
            }

            foreach (Metric metric in gaDataEntry.Metrics)
            {
                switch (metric.Name)
                {
                    case "ga:visitors": uniqueVisitors = Convert.ToInt32(metric.Value);
                        break;
                    case "ga:visits": visits = Convert.ToInt32(metric.Value);
                        break;
                    case "ga:transactions": transactions = Convert.ToInt32(metric.Value);
                        break;
                }
            }
        }
コード例 #3
0
        public PaidSearchVisitSummary(DataEntry gaDataEntry, Site site)
        {
            gaAccount = site.account;

            foreach (Dimension dimension in gaDataEntry.Dimensions)
            {
                switch (dimension.Name)
                {
                    case "ga:date": gaDate = DateTime.ParseExact(dimension.Value, "yyyyMMdd", null);
                        break;
                    case "ga:source": source = dimension.Value;
                        break;
                    case "ga:medium": medium = dimension.Value;
                        break;
                    case "ga:pagePath": pagePath = dimension.Value;
                        break;
                }
            }

            foreach (Metric metric in gaDataEntry.Metrics)
            {
                switch (metric.Name)
                {

                    case "ga:visits": visits = Convert.ToInt32(metric.Value);
                        break;
                }
            }
        }
コード例 #4
0
        public SiteEvent(DataEntry gaDataEntry, Site site)
        {
            gaAccount = site.account;

            foreach (Dimension dimension in gaDataEntry.Dimensions)
            {
                switch (dimension.Name)
                {
                    case "ga:date": gaDate = DateTime.ParseExact(dimension.Value, "yyyyMMdd", null);
                        break;
                    case "ga:eventCategory": category = dimension.Value;
                        break;
                    case "ga:eventAction": action = dimension.Value;
                        break;
                    case "ga:eventLabel": label = dimension.Value;
                        break;
                }
            }

            foreach (Metric metric in gaDataEntry.Metrics)
            {
                switch (metric.Name)
                {
                    case "ga:totalEvents": totalEvents = Convert.ToInt32(metric.Value);
                        break;
                    case "ga:uniqueEvents": uniqueEvents = Convert.ToInt32(metric.Value);
                        break;
                }
            }
        }
コード例 #5
0
ファイル: Search.cs プロジェクト: ravintpillai/AnalyticsAPI
 public Search(DataEntry gaDataEntry)
 {
     foreach (Dimension dimension in gaDataEntry.Dimensions)
     {
         switch (dimension.Name)
         {
             case "ga:visitLength": visitLength = Convert.ToInt32(dimension.Value);
                 break;
             case "ga:searchUsed": searchUsed = (dimension.Value == "Visits With Site Search");
                 break;
             case "ga:transactionId": orderNumber = dimension.Value;
                 break;
         }
     }
 }
コード例 #6
0
 public GeoSystem(DataEntry gaDataEntry)
 {
     foreach (Dimension dimension in gaDataEntry.Dimensions)
     {
         switch (dimension.Name)
         {
             case "ga:city": city = dimension.Value;
                 break;
             case "ga:country": country = dimension.Value;
                 break;
             case "ga:language": language = dimension.Value;
                 break;
             case "ga:isMobile": isMobile = (dimension.Value == "Yes");
                 break;
             case "ga:transactionId": orderNumber = dimension.Value;
                 break;
         }
     }
 }
コード例 #7
0
ファイル: Visitor.cs プロジェクト: ravintpillai/AnalyticsAPI
 public Visitor(DataEntry gaDataEntry)
 {
     foreach (Dimension dimension in gaDataEntry.Dimensions)
     {
         switch (dimension.Name)
         {
             case "ga:daysSinceLastVisit": daysSinceLastVisit = Convert.ToInt32(dimension.Value);
                 break;
             case "ga:pageDepth": pageDepth = Convert.ToInt32(dimension.Value);
                 break;
             case "ga:visitCount": visitCount = Convert.ToInt32(dimension.Value);
                 break;
             case "ga:visitorType": isNewVisitor = (dimension.Value == "New Visitor");
                 break;
             case "ga:landingPagePath": landingPagePath = dimension.Value;
                 break;
             case "ga:transactionId": orderNumber = dimension.Value;
                 break;
         }
     }
 }
コード例 #8
0
        public AdwordsCost(DataEntry gaDataEntry, Site site)
        {
            gaAccount = site.account;

            foreach (Dimension dimension in gaDataEntry.Dimensions)
            {
                switch (dimension.Name)
                {
                    case "ga:source": source = dimension.Value;
                        break;
                    case "ga:medium": medium = dimension.Value;
                        break;
                    case "ga:keyword": keywords = dimension.Value;
                        break;
                    case "ga:adwordsCampaignID": adwordsCampaign = dimension.Value;
                        break;
                    case "ga:date": gaDate = DateTime.ParseExact(dimension.Value, "yyyyMMdd", null);
                        break;
                }
            }

            foreach (Metric metric in gaDataEntry.Metrics)
            {
                switch (metric.Name)
                {
                    case "ga:adClicks": clickCount = Convert.ToInt32(metric.Value);
                        break;
                    case "ga:transactions": transactionCount = Convert.ToInt32(metric.Value);
                        break;
                    case "ga:adCost": adCost = Convert.ToDouble(metric.Value);
                        break;
                    case "ga:transactionRevenue": transactionRevenue = Convert.ToDouble(metric.Value);
                        break;
                }
            }
        }
コード例 #9
0
 public void DataEntryConstructorTest()
 {
     DataEntry target = new DataEntry();
     Assert.IsNotNull(target, "object better not be null");
 }