Skip to content

Embed widget should support the same public site id as the tracking script (hex sites.id) #994

Description

@pedrocasado

Describe the bug

The tracking script snippet uses the public site identifier from data-site-id, which is the hex sites.id (e.g. 8fa88b4237b1) when present.

The embed widget UI (iframe snippet under Embed settings) currently builds URLs as /widget/<numeric site_id> only (sites.site_id).

The embed widget should support both ids: int and hex ones

To Reproduce

Embed tab produces /widget/<number> even when the site has a hex public id.

<iframe
  src="BASE_URL/15?variant=card&theme=dark&minutes=30&chart=true&countries=true"
  style="border: 0; width: 360px; height: 390px; max-width: 100%;"
  loading="lazy"
  title="Live visitors"
></iframe>

Expected behavior

<iframe
  src="BASE_URL/8fa88b4237b1?variant=card&theme=dark&minutes=30&chart=true&countries=true"
  style="border: 0; width: 360px; height: 390px; max-width: 100%;"
  loading="lazy"
  title="Live visitors"
></iframe>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions