Skip to content
This repository was archived by the owner on Dec 11, 2019. It is now read-only.

Conversation

@noah-berman
Copy link

Created new option value for trackGalleryClicksAsPageviews, which should be added a toggle in the Segment UI. This creates an additional condition that only calls pSUPERFLY when the user has selected this toggle or if there has been an event that turned urlChanged to true.

TO-DO:

  • hook up urlChanged to an actual URL change event within segment architecture
  • set up a new toggle in the UI that connects to trackGalleryClicksAsPageviews

lib/index.js Outdated
var onBody = require('on-body');

/** TO-DO: connect urlChanged to Segment URL-change event **/
var urlChanged = true;
Copy link

Choose a reason for hiding this comment

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

Hey @noah-berman - the analytics.js api currently doesn't expose any kind of url change hook. Is there something else that you could reference to test for url changes?

Copy link

Choose a reason for hiding this comment

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

One option would be to store the value of window.location.href in a class property (called something like currentUrl) when initialize is called (which should only be when the DOM is refreshed). Then, inside page, check to see if window.location.href is equal to this.currentUrl. If not, then call virtualPage. If so, then do the regular page load logic.

this.pageCalledYet = true;
this._initialize();
} else {
} else if (this.options.trackGalleryClicksAsPageviews || urlChanged) {
Copy link

Choose a reason for hiding this comment

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

It feels like the name of this option is very specific for user's that have image galleries. Are there potentially other types of sites that might use this feature?

@noah-berman
Copy link
Author

@ccnixon you were correct in the window.location.href suggestion - just added that to the logic now.

We do know of other sites where the major cause of pageview issues is specifically Gallery Clicks (understanding that it is an oddly specific thing to label as an option). If possible, in addition to naming it as such, a small blurb explaining what it does (e.g. "calls Chartbeat for all new pages regardless of page refresh or URL change") I believe would be sufficient.

@SegmentDestinationsBot
Copy link
Contributor

Hi @noah-berman, as part of the monorepo migration, this issue has been moved to new issue. Our engineers have been notified and will prioritize and work on it ASAP. Thank you!

For more information, see README.md.

@SegmentDestinationsBot SegmentDestinationsBot added the migrated The issue has been migrated label Dec 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

migrated The issue has been migrated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants