程序代写代做代考 CS688 Assignment 2: Google Analytics

CS688 Assignment 2: Google Analytics
Please follow the submission requirements at the end of the assignment!
Objectives: First, demonstrate your knowledge of Web Analytics and how it can help you understand your online. You must describe what your goals are focus on conversion of customers (visitors) to these goals. Second, apply the R package googleAnalyticsR. Third, demonstrate your ability to create functions.
Make sure you complete both pages of questions.
Part A: (20 points)
• Find out what auto tagging is. Explain when auto tagging could be used. (6 points)
• If you wanted to enable e-commerce on your website, how would you do this? Show screenshots and/or provide references. (You do not have to turn any options on in your account. Just show what you would do.) (7 points)
• Assume you have a funnel that requires visitors to complete some steps (an example would be payment processing) on a different web site. Discuss whether you will be able to include Google Analytics tracking code on the third-party web site. How will you be able to assess goal abandonment? (7 points)
Part B: (30 points)
Pull and present 6 analytics reports (1 report each for #1, #2, #3 below, and 3 reports for #4 below). Ensure that at least one of the reports uses a different chart type (bar, line, pie, etc.) than the others.
Explain how these reports are (or could be) relevant and what insights you or a business leader could receive by reviewing these analytics reports. These reports should include:
• Pageviews (7 points)
• Goals and conversions (7 points)
• Real time data (6 points)
• Any other three relevant reports that your stakeholders might be interested in. Note: understand what Part C(1) below is going to ask you to do before you complete this task. (10 points)
Part C: (30 points)
Use the googleAnalyticsR package to pull and plot various analytics reports you used in Part B. You can modify the R code for Module 2 to reflect the relevant Google Analytics metrics and dimensions on your website. For each report, include the R code, the R plot and the corresponding screen shot from your Google Analytics report that is confirming your R plot.
• Create plots in R that match the ones you got from Google Analytics in Part B(4) above. (15 points)
• Create one data table in R which contains at least two of the metrics from part C(1). Also include at least two dimensions (you may want to do research on this to better understand dimensions in GA). This data table should be filtered to help identify the most interesting results (probably high or low metrics for particular combinations of your dimensions). (15 points)
Part D: (20 points)
Simplify the following code by creating a function and then calling the function. You should call the function only one time and pass the three stock symbols in as a vector. To accomplish this you can take one of these approaches:
• Add a for() loop to iterate through the stock symbols sent in the input vector (you will get a maximum of 15 points if you do it this way)
• Write two functions, The first function needs to handle one stock symbol at a time, and the second function will handle the vector. In the second function, you’ll use one of the *apply() functions (you need to figure out which), referring back to the first function.
Please be sure to write readable code and make significant efforts to reduce the length of the code provided here. One way to get “readable code” in RStudio is to use the menu option Code Reformat Code. (Do not use semicolons to enable you to combine lines.)
library(quantmod)

PGdiv <- getDividends("PG", auto.assign=F) PGdiv.matrix <- as.matrix(PGdiv) indx <- tail(which(diff(PGdiv.matrix)>0),1)+1
divamt <- PGdiv.matrix[indx] chgdate <- rownames(PGdiv.matrix)[indx] ntimes <- sum(PGdiv.matrix==PGdiv.matrix[indx]) data.frame(stock="PG", currentDivAmt=divamt, dateDivAmtLastChanged=chgdate, nPayoutsAtCurrDivAmt=ntimes) MSFTdiv <- getDividends("MSFT", auto.assign=F) MSFTdiv.matrix <- as.matrix(MSFTdiv) indx <- tail(which(diff(MSFTdiv.matrix)>0),1)+1
divamt <- MSFTdiv.matrix[indx] chgdate <- rownames(MSFTdiv.matrix)[indx] ntimes <- sum(MSFTdiv.matrix==MSFTdiv.matrix[indx]) data.frame(stock="MSFT", currentDivAmt=divamt, dateDivAmtLastChanged=chgdate, nPayoutsAtCurrDivAmt=ntimes) TGTdiv <- getDividends("TGT", auto.assign=F) TGTdiv.matrix <- as.matrix(TGTdiv) indx <- tail(which(diff(TGTdiv.matrix)>0),1)+1
divamt <- TGTdiv.matrix[indx] chgdate <- rownames(TGTdiv.matrix)[indx] ntimes <- sum(TGTdiv.matrix==TGTdiv.matrix[indx]) data.frame(stock="TGT", currentDivAmt=divamt, dateDivAmtLastChanged=chgdate, nPayoutsAtCurrDivAmt=ntimes) Optional: Add to Part D to earn a Bonus (5 points) Add comments to your function that correctly explain how this code works. Explain what each line is doing. You will probably need a multi-line comment to adequately explain why indx is computed the way it is. SUBMISSION REQUIREMENTS: • Create a Word, PDF, or Rmd document. If you use Rmd you will need to make sure to save the output as a PDF. • For each question, state the question you are answering. Then answer the question by explaining in sentences (in English, not in R or other languages) what you did to get to the answer. You may include screenshots and/or copy-paste of key lines of code and the corresponding output in your answer. (If you are using Rmd, this means you must generally use echo=FALSE and/or include=FALSE for the body of the document.) • Full code should be included as an Appendix to your Word or PDF document. Coding must be in R. Do NOT include full code in the main part of your document. • Please ensure that a Word or PDF file as the first file in your submission. • You may also separately upload your R and/or Rmd code to Blackboard. • If your facilitator tells you to submit the files differently than the above guidelines, you are expected to respect your facilitator’s wishes starting on the next assignment. • Facilitators can deduct up to 20% if you fail to follow these requirements (more if the questions are not actually answered). • Facilitators can deduct 5% for each day the assignment is late. You may submit one (and only one) of the six assignments up to three days late with no penalty but all other assignments will be penalized. • Unless your facilitator or the professor agrees, your assignment will not be graded if it is more than 3 days late (e.g., no credit will be given after Friday at 6 AM Boston time). The professor will usually ask the facilitator to make the decision but in rare cases (<1% of the time) has overridden a facilitator. Do not expect the professor to override in most cases.