Skip to content

Track Jetpack-powered Twitter embeds #5984

@niallkennedy

Description

@niallkennedy

Twitter supports tracking discovery and publishing tools powering the embed experience by adding a partner data attribute to embed markup. If Twitter's widgets JavaScript runs on the page and sees markup such as <blockquote class="twitter-tweet" data-partner="jetpack"> or <a class="twitter-timeline" data-partner="jetpack"> it's very likely Jetpack helped a site publish an embed and Jetpack's reach could be better understood from an embed provider's perspective. Knowing reach helps prioritize future code contributions.

Sound interesting? In the tweet shortcode a new query argument would be added in the extra_args function: partner=jetpack. In twitter_timeline_shortcode the string builder would add data-partner="jetpack" in the anchor element.

The jetpack attribute value is freeform and could similarly be wpcom depending on the environment.

You can see the partner data attribute in action when generating embed HTML through TweetDeck.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions