/// <summary>
        /// Run the code example.
        /// </summary>
        /// <param name="service">An initialized Dfa Reporting service object
        /// </param>
        public override void Run(DfareportingService service)
        {
            long activityId = long.Parse(_T("ENTER_ACTIVITY_ID_HERE"));
            long profileId  = long.Parse(_T("INSERT_USER_PROFILE_ID_HERE"));

            // Generate the floodlight activity tag.
            FloodlightActivitiesResource.GeneratetagRequest request =
                service.FloodlightActivities.Generatetag(profileId);
            request.FloodlightActivityId = activityId;

            FloodlightActivitiesGenerateTagResponse response = request.Execute();

            if (response.GlobalSiteTagGlobalSnippet != null)
            {
                // This is a global site tag, display both the global snippet and event snippet.
                Console.WriteLine("Global site tag global snippet:\n\n{0}",
                                  response.GlobalSiteTagGlobalSnippet);
                Console.WriteLine("\n\nGlobal site tag event snippet:\n\n{0}",
                                  response.FloodlightActivityTag);
            }
            else
            {
                // This is an image or iframe tag.
                Console.WriteLine("Floodlight activity tag:\n\n{0}", response.FloodlightActivityTag);
            }
        }
Пример #2
0
        /// <summary>
        /// Run the code example.
        /// </summary>
        /// <param name="service">An initialized Dfa Reporting service object
        /// </param>
        public override void Run(DfareportingService service)
        {
            long activityId = long.Parse(_T("ENTER_ACTIVITY_ID_HERE"));
            long profileId  = long.Parse(_T("INSERT_USER_PROFILE_ID_HERE"));

            // Generate the floodlight activity tag.
            FloodlightActivitiesResource.GeneratetagRequest request =
                service.FloodlightActivities.Generatetag(profileId);
            request.FloodlightActivityId = activityId;

            FloodlightActivitiesGenerateTagResponse response = request.Execute();

            // Display the floodlight activity tag.
            Console.WriteLine(response.FloodlightActivityTag);
        }