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

Track Jetpack-powered Twitter embeds #5984

Closed
niallkennedy opened this issue Dec 22, 2016 · 2 comments · Fixed by #6190
Closed

Track Jetpack-powered Twitter embeds #5984

niallkennedy opened this issue Dec 22, 2016 · 2 comments · Fixed by #6190
Labels
[Feature] Extra Sidebar Widgets [Feature] Shortcodes / Embeds [Pri] Normal [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it

Comments

@niallkennedy
Copy link
Contributor

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.

@jeherve jeherve added [Feature] Extra Sidebar Widgets [Feature] Shortcodes / Embeds [Pri] Normal [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it labels Dec 22, 2016
@jeherve jeherve added this to the 4.6 milestone Dec 22, 2016
@jom
Copy link
Member

jom commented Jan 27, 2017

I can work on this. Do we want to distinguish between jetpack and wpcom? Is IS_WPCOM the best way to determine this?

@jeherve
Copy link
Member

jeherve commented Jan 27, 2017

@jom Sounds like a good plan! Instead of using IS_WPCOM, another alternative would be to use a filter, so we can then modify the value on WordPress.com. This would have the added benefit of allowing site owners (imagine the owner of a multisite network for example) customize that value on their end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extra Sidebar Widgets [Feature] Shortcodes / Embeds [Pri] Normal [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants