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

Fix global track props on Backend Tracks Events #201

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

mehmoodak
Copy link
Member

  • Updated Tracks prop keys from vipgo_env to vip_env and vipgo_org to vip_org.
  • During testing, I've noticed that global props of tracks aren't getting logged due to a race condition - track props are calculated before WP is fully loaded.

@mehmoodak mehmoodak self-assigned this Nov 16, 2024

public function __construct() {
if ( function_exists( 'Automattic\VIP\Telemetry\Tracks\get_tracks_core_properties' ) ) {
add_action( 'init', function (): void {
Copy link
Member Author

Choose a reason for hiding this comment

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

Instead of assigning variables inside the action hook and then using them, I've refactored the code to retrieve the necessary values directly. This approach avoids potential issues that can arise from calculating values based on an empty array.

@mehmoodak mehmoodak marked this pull request as ready for review November 16, 2024 00:04
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.

1 participant