Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement detailed analytics #222

Open
2 of 3 tasks
iteles opened this issue May 13, 2017 · 13 comments
Open
2 of 3 tasks

Implement detailed analytics #222

iteles opened this issue May 13, 2017 · 13 comments
Assignees
Labels
bug Suspected or confirmed bug (defect) in the code enhancement New feature or enhancement of existing functionality priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished T4h Time Estimate 4 Hours
Milestone

Comments

@iteles
Copy link
Member

iteles commented May 13, 2017

As a dwyl site owner, I want to collect data on usage of my website so that I can target the content to those people.

@iteles iteles added enhancement New feature or enhancement of existing functionality help wanted If you can help make progress with this issue, please comment! priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished labels May 13, 2017
@nelsonic nelsonic added priority-1 Highest priority issue. This is costing us money every minute that passes. and removed priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished labels May 13, 2017
@nelsonic
Copy link
Member

Increased priority as we need to start making decisions based on the data/insight from this. 👍

@harrygfox
Copy link
Member

harrygfox commented May 25, 2017

Navigation Menu

Track user Clicks on MENU ITEMS

  • What was the user's URL at the time they clicked?
  • What did they click on?
  • What happened next - did they bounce? did they go somewhere else?

@harrygfox
Copy link
Member

harrygfox commented May 25, 2017

Services Page

  • The goal here is to engage potential clients with relevant content and convert that engagement into submission of an email address.

Potential Barriers

  • Unconvincing content
    • METRIC did they click on a case study and then leave?
    • METRIC did they scroll to the bottom and then leave?
  • Form Abandonment
    • METRIC did they enter fields into the form and not complete it?
    • METRIC did they click contact link but did not complete contact form?

@ghost ghost added priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished and removed priority-1 Highest priority issue. This is costing us money every minute that passes. labels Aug 23, 2017
@ghost ghost assigned Cleop Aug 23, 2017
@ghost ghost added this to the Sprint 1 milestone Aug 23, 2017
@ghost ghost added the T4h Time Estimate 4 Hours label Aug 23, 2017
@Cleop Cleop added in-progress An issue or pull request that is being worked on by the assigned person and removed help wanted If you can help make progress with this issue, please comment! labels Sep 13, 2017
Cleop added a commit that referenced this issue Sep 13, 2017
@Cleop Cleop removed the in-progress An issue or pull request that is being worked on by the assigned person label Sep 13, 2017
iteles added a commit that referenced this issue Sep 14, 2017
@iteles
Copy link
Member Author

iteles commented Sep 14, 2017

@Cleop Based on your research and conversations with @Danwhy, please split this issue out into chunks that you can explain and estimate so as to capture the information you have already gathered, even if we don't get around to completing everything.

  • Clicks to navigation items should be the highest priority and I suspect the simplest to implement
  • Scrolling and understanding where on the page people leave would be my next priority (form abandonement is also very useful but we can deduce an elementary metric of this based on navigation item clicks and the number of emails we get)

@Cleop
Copy link
Member

Cleop commented Sep 14, 2017

  • where submitting contact form
  • navigation links - which ones are people are people clicking on, from where.
  • how far down are people scrolling, at what point are people coming off the page?

@Cleop
Copy link
Member

Cleop commented Sep 15, 2017

@iteles - how do you think I should test my tag manager/ analytics work? Currently both are hooked up to dwyl.com but the redesign is set up on: dwyl.github.io/dwyl-site. dwyl.com doesn't have the tag manager scripts in.

I could redirect the tag manager stuff to the gh pages site for now but I don't want to lose the previous/live data from the existing site for google analytics. Do you think setting up another google analytics account for the gh pages site and redirecting tag manager would be best? Or I could pop the tag manager script on the existing site? Or another alternative?

@Cleop Cleop added the in-progress An issue or pull request that is being worked on by the assigned person label Sep 15, 2017
@iteles
Copy link
Member Author

iteles commented Sep 15, 2017

@Cleop Whichever you think makes the most sense. Happy for you to set up a test GA account for now which we then swap over to the one we want to use, but only if that's not very complex!

@Cleop Cleop removed the in-progress An issue or pull request that is being worked on by the assigned person label Sep 15, 2017
@ghost ghost modified the milestones: Sprint 1, Post-deployment Sep 22, 2017
@ZooeyMiller
Copy link
Contributor

@finnhodgkin and I have looked into setting up analytics for which navigation link was clicked, and from which page, and this will be straightforward once we have access to the correct tag manager account.

We've done this on my own tag manager account with github pages just because it's what we have access to. We're now going to look into the analytics with tag manager to explore scrolling.

@ZooeyMiller
Copy link
Contributor

We've been working on a code block for a tag in GTM to register a users' maximum scroll height, and send the maximum scroll height when they leave the page. We have had a chance to test it with GTM yet but we've played with everything bar the pushing of the datalayer in the browser console, and it all works as expected.

  <script>
  var scrollHeight = 0
  window.addEventListener("scroll", (e) => {
    if(window.pageYOffset > scrollHeight) {
      scrollHeight = window.pageYOffset;
    }
  })

  var scrollableHeight = document.body.scrollHeight - window.innerHeight
  
  window.addEventListener("beforeunload", () => {
     dataLayer.push({'event':'scrollTracking','scrollDepth': (scrollHeight / scrollableHeight) * 100})
  })
  </script>

@finnhodgkin
Copy link
Contributor

Couple issues we need to fix:

  • Scroll height should be pushed in increments (25%, 50%, etc) so the data is grouped and easier to analyse on GA.
  • Add time spent on page. Scroll height by itself isn't that great a metric - users will sometimes super quickly scroll around a page without actually taking anything in

@ZooeyMiller
Copy link
Contributor

ZooeyMiller commented Sep 27, 2017

We've tested the script on my github pages test site and it works as expected. We've modified it so that rather than giving a precise percentage it gives the percent rounded down to the nearest 20. Is this
increment okay? Or would we prefer a different one?

EDIT: the old script messed up when the page was resized, but we've made a new one which accounts for this, and tracks the amount of time the user spends on the page.

<script>
(function(){
  var pageLoad = Date.now()
  var scrollableHeight = document.body.scrollHeight - window.innerHeight;

  var scrollPercent = 0;

  window.addEventListener('scroll', function() {
    var newScrollPercent = window.pageYOffset / scrollableHeight * 100;
    if (newScrollPercent > scrollPercent) {
      scrollPercent = newScrollPercent;
    }
  });

  window.addEventListener('resize', function() {
    scrollableHeight = document.body.scrollHeight - window.innerHeight;
  })

  window.addEventListener('beforeunload', function() {
    var roundedDownToTwenty = Math.floor(scrollPercent / 20) * 20;
    var timeOnPage = Date.now() - pageLoad;
    var readableTimeOnPage = new Date(timeOnPage).toISOString().substr(-12, 7);
    dataLayer.push({ event: 'scrollTracking', scrollDepth: roundedDownToTwenty, 'timeOnPage': readableTimeOnPage });
  });
})()
</script>

OLD SCRIPT:

  <script>
  var scrollHeight = 0
  window.addEventListener("scroll", function() {
    if(window.pageYOffset > scrollHeight) {
      scrollHeight = window.pageYOffset;
    }
  })

  var scrollableHeight = document.body.scrollHeight - window.innerHeight
  
  window.addEventListener("beforeunload", function(){
    var scrollPercent = (scrollHeight / scrollableHeight) * 100;
    var roundedDownToTwenty = Math.floor(scrollPercent / 20) * 20;
     dataLayer.push({'event':'scrollTracking','scrollDepth': roundedDownToTwenty})
  })
  </script>

@ghost
Copy link

ghost commented Oct 3, 2017

screen shot 2017-10-03 at 11 37 57

tag manager error

@ghost ghost added the bug Suspected or confirmed bug (defect) in the code label Oct 3, 2017
@ZooeyMiller ZooeyMiller added the in-progress An issue or pull request that is being worked on by the assigned person label Oct 3, 2017
@ZooeyMiller ZooeyMiller removed the in-progress An issue or pull request that is being worked on by the assigned person label Oct 3, 2017
@ZooeyMiller
Copy link
Contributor

We've PR'ed the new GTM links, and set up the nav clicks and scroll tracking on GTM, once #410 is merged these will be live on the site and we can look into how they're working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Suspected or confirmed bug (defect) in the code enhancement New feature or enhancement of existing functionality priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished T4h Time Estimate 4 Hours
Projects
None yet
Development

No branches or pull requests

6 participants