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

WV-553 Analytics Data Capture: Candidate/Politician landing page loads [CHANGES NEEDED] #4247

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

Zubin-glitch
Copy link

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.

@DaleMcGrew DaleMcGrew changed the title Added Data Layer to Politician Loading Page Added Data Layer to Politician Loading Page WV-731 [TEAM REVIEW] Feb 6, 2025
@Zubin-glitch Zubin-glitch changed the title Added Data Layer to Politician Loading Page WV-731 [TEAM REVIEW] WV-731 Analytics Data Capture: Candidate/Politician landing page loads [MERGE READY] Feb 27, 2025
@Zubin-glitch Zubin-glitch changed the title WV-731 Analytics Data Capture: Candidate/Politician landing page loads [MERGE READY] WV-553 Analytics Data Capture: Candidate/Politician landing page loads [MERGE READY] Feb 27, 2025
@DaleMcGrew DaleMcGrew changed the title WV-553 Analytics Data Capture: Candidate/Politician landing page loads [MERGE READY] WV-553 Analytics Data Capture: Candidate/Politician landing page loads [CHANGES NEEDED] Mar 1, 2025
Copy link
Member

@DaleMcGrew DaleMcGrew left a 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');
Copy link
Member

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);
Copy link
Member

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",
Copy link
Member

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');
Copy link
Member

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
Copy link
Member

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.

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.

2 participants