Support » Plugin: WordPress Sentry » Remove Tags WP

  • hello everyone I just want to ask how do I remove

    var wp_sentry = {"dsn":"https:\/\/xxx@o453997.ingest.sentry.io\/xx","release":"2.2.5","environment":"production","content":{"user":{"id":1,"name":"xxx","email":"xxx","username":"xxx"},"tags":{"wordpress":"5.x","language":"id-ID"}}};

    tags WordPress and version wordpress
    thakyou

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Alex

    (@stayallive)

    Hi there,

    I think you want to disable to browser side error tracking of this plugin but want to keep the server side error tracking?

    This is done by removing the following 2 constants from your wp-config.php file: WP_SENTRY_PUBLIC_DSN and/or WP_SENTRY_BROWSER_DSN (don’t worry if you have only 1).

    If that’s not what you want you will have to explain a bit more what you want to achieve!?

    I want to track error from js and PHP or server-side too, but when I put tracking, it automatically set variable environment sent in variable ‘wp_sentry’, I just want to modify inside that object and remove information about WordPress and version WordPress, it’s okay if tracker error set user or language but I don’t want put my WordPress information. so I need to remove the WordPress property and version value in that object, can I?

    Plugin Author Alex

    (@stayallive)

    Ah sorry I misunderstood, in that case you can use this filter to achieve that:

    add_filter( 'wp_sentry_public_context', function ( array $context ): array {
        unset( $context['tags']['wordpress'] );
    
        return $context;
    } );
    • This reply was modified 2 months, 1 week ago by Alex. Reason: Fix formatting
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.