# Embed an External Analytics Dashboard

> Adds a dashboard widget that shows a shared dashboard from another service, such as a public Plausible, Looker Studio or uptime status page, so clients see their numbers without another login.

- Type: PHP
- Runs: Admin only
- Category: [Dashboard](https://wpide.com/library/category/dashboard/)
- Tags: dashboard-widget, analytics, embed
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/dash-external-dashboard-embed/

## Code

```php
// Public embed or share link (https only).
$wpide_embed_url    = 'https://plausible.io/share/example.com?auth=YOUR_SHARED_LINK_KEY&embed=true&theme=light';
$wpide_embed_title  = 'Site analytics';
$wpide_embed_height = 600;

add_action( 'wp_dashboard_setup', function () use ( $wpide_embed_url, $wpide_embed_title, $wpide_embed_height ) {
    if ( ! current_user_can( 'edit_posts' ) || 0 !== strpos( $wpide_embed_url, 'https://' ) ) {
        return;
    }

    wp_add_dashboard_widget( 'wpide_external_embed', $wpide_embed_title, function () use ( $wpide_embed_url, $wpide_embed_title, $wpide_embed_height ) {
        printf(
            '<iframe src="%s" title="%s" loading="lazy" referrerpolicy="no-referrer" style="width:100%%;height:%dpx;border:0"></iframe><p><a href="%s" target="_blank" rel="noopener">Open in a new tab</a></p>',
            esc_url( $wpide_embed_url ),
            esc_attr( $wpide_embed_title ),
            (int) $wpide_embed_height,
            esc_url( $wpide_embed_url )
        );
    } );
} );
```

## Notes

Paste the service's public share or embed link into $wpide_embed_url; the service must allow being shown in a frame.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Embed an External Analytics Dashboard" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
