-
Notifications
You must be signed in to change notification settings - Fork 311
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
WV-553 Analytics Data Capture: Candidate/Politician landing page loads [CHANGES NEEDED] #4247
base: develop
Are you sure you want to change the base?
Conversation
…ce, as per Dale's suggestions
…update its value by calling setState()
…er and politician object
…, politician, pageDetails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Zubin-glitch!
@@ -164,15 +167,24 @@ class PoliticianDetailsPage extends Component { | |||
} | |||
|
|||
componentDidMount () { | |||
// console.log('PoliticianDetailsPage componentDidMount'); | |||
console.log('PoliticianDetailsPage componentDidMount'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please comment out.
// console.log('onPoliticianStoreChange politicianSEOFriendlyPathFromUrl: ', politicianSEOFriendlyPathFromUrl, ', politicianWeVoteIdFromParams: ', politicianWeVoteIdFromParams); | ||
console.log('onPoliticianStoreChange politicianSEOFriendlyPathFromUrl: ', politicianSEOFriendlyPathFromUrl, ', politicianWeVoteIdFromParams: ', politicianWeVoteIdFromParams); | ||
// Experimental TagManager add (WORKS!) | ||
const politician = PoliticianStore.getPoliticianBySEOFriendlyPath(politicianSEOFriendlyPathFromUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this to componentDidUpdate, but implement a "gate" so that it only calls Google Tag Manager once.
@@ -127,6 +127,7 @@ | |||
"d3-zoom": "^3.0.0", | |||
"flux": "~4.0.1", | |||
"fs-extra": "^10.0.0", | |||
"fsevents": "^2.3.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Zubin-glitch we can't check in fsevents as a requirement because it only works on Mac computers. Please back out this change, and the package-lock.json file.
@@ -28,7 +28,7 @@ class PoliticianRetrieveController extends Component { | |||
politicianWeVoteId, | |||
} = this.props; | |||
if (politicianWeVoteId !== previousPoliticianWeVoteId) { | |||
// console.log('PoliticianRetrieveController componentDidUpdate politicianWeVoteId has changed'); | |||
console.log('PoliticianRetrieveController componentDidUpdate politicianWeVoteId has changed'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ask that console logs be commented out with checkins, so we can keep the production version console empty of most WeVote logging.
@@ -136,6 +137,7 @@ class PoliticianStore extends ReduceStore { | |||
return positionsAboutPolitician[orgWeVoteId] || []; | |||
} | |||
|
|||
// Ask Dale about why this is needed - Zubin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added this getVoterCanEditThisPolitician
stub because we are planning to make it so the staff of politicians can update Politician information on WeVote, and the staff would be signed in with a WeVote voter account.
What github.com/wevote/WebApp/issues does this fix?
It adds a data layer to the Politician's landing/loading page
Changes included this pull request?
Added TagManager.dataLayer(), capturing the following: voterWeVoteId, politicianWeVoteId, politicianName and politicianState (state code).
Google Tag Manager captures information after a Politician's name (hyperlink) is clicked on their display card opening their page.