Skip to content

Conversation

@chasenlehara
Copy link
Member

The survey-ad control is shown at the bottom of every page. If you click almost anywhere in the bar, the survey landing page will open in a new tab/window.

At the far right of the bar, there’s a close button that will animate the bar out of view and store the current time in localStorage. When the page first loads, we check for the presence of that localStorage item to decide whether the bar should be shown or not.

The bar is only enabled for desktop (1000px+ wide) screens. The only bug I’ve found is when you use search while the bar is still present; in that situation, you can see all of the search results, but the scroll bar goes under the bar. I don’t think that’s a blocker.

Screenshot:
localhost-8080-index html

Gif showing how it interacts with the rest of the content & sidebar:
survey ad for canjs

The `survey-ad` control is shown at the bottom of every page. If you click almost anywhere in the bar, the survey landing page will open in a new tab/window.

At the far right of the bar, there’s a close button that will animate the bar out of view and store the current time in localStorage. When the page first loads, we check for the presence of that localStorage item to decide whether the bar should be shown or not.

The bar is only enabled for desktop (1000px+ wide) screens. The only bug I’ve found is when you use search while the bar is still present; in that situation, you can see all of the search results, but the scroll bar goes under the bar. I don’t think that’s a blocker.

This is related to canjs/canjs#3548
var didClose = window.localStorage.getItem(storageKey);
if (didClose) {
// Immediately hide this element
surveyAdElement.style.display = 'none';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered hiding by default and showing if needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I would rather have the link be shown when JS is disabled or localStorage is unavailable than hide it in those cases.

var surveyAdElement = this.element;

// Always show the close button since JS is active
var closeButton = surveyAdElement.querySelector('.close');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Props for avoiding jQuery 👏

'{element} .close click': function() {

// Add .hidden so the element animates out of view
this.element.classList.add('hidden');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this still get triggered in IE? If so, classList.add would throw, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The close button is hidden by default and only enabled if line 11 can run, so this event will never fire in IE9.

text-align: center;
transition: bottom @transition-speed ease;
width: 100%;
z-index: 90;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 90 really needed? I don't doubt it, just curious.

Copy link
Member Author

@chasenlehara chasenlehara Sep 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is the same z-index as #right; if I change the code I can update it with a note about where this value comes from.

@justinbmeyer
Copy link
Contributor

It takes up a lot of space, especially by it going over the sidebar. Can we make it a little less obtrusive?

untitled

@justinbmeyer
Copy link
Contributor

Alternatively, we could put in between the

  • White - Chat | Forum | start navigation
  • Black - Search and breadcrumb

@chasenlehara
Copy link
Member Author

I don’t think it takes up that much space and it’s the right amount of attention grabbing, but talking through our options:

  • I like putting it in the space between the Twitter followers and Bitovi logo, but I’m not sure how well that’ll translate to the DoneJS and StealJS sites (I was planning on keeping them relatively consistent).
  • I think people would not see it in the black bar (in user testing people didn’t see the “On this page” nav).
  • I think some sort of popover over the content would be more obtrusive because it’d cover the content; it’s more likely to catch my eye and I’m more likely to close it because it’s in the way.

I think if it’s more integrated into the design, it’s less obtrusive and people are less likely to be annoyed by it, so if they don’t want to sign up the first time they see it, they’d be willing to let it be and come back to it later.

After the user visits CanJS.com for the first time, we count any additional page loads (across sessions) as “engagements.” After three engagements, we show them the survey-ad.

This shifts the control to showing unless dismissed to only showing if they have JS enabled and have interacted with the site a few times.
@chasenlehara
Copy link
Member Author

@justinbmeyer, as we discussed this morning, I changed the control to hide by default and only show after the user loads a few pages.
survey ad for canjs

@chasenlehara chasenlehara merged commit be1b596 into master Sep 22, 2017
@chasenlehara chasenlehara deleted the survey-prototype branch September 22, 2017 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants