Topic-icon [Missed] twitter:site (open graph tag)

Active Subscriptions:

None
11 years 10 months ago #45631 by alechu
I'm not can see tag:
<meta name="twitter:site" content="@nytimesbits">

and probably for users, for JomSocial, tag:
<meta name="twitter:creator" content="@nickbilton">
(no for news, only for users on JomSocial/Kunena/etc)


from dev.twitter.com :
Twitter Cards and Open Graph

You'll notice that Twitter card tags look similar to Open Graph tags, and that's because they are based on the same conventions as the Open Graph protocol. If you're already using Open Graph protocol to describe data on your page, it’s easy to generate a Twitter card without duplicating your tags and data. When the Twitter card processor looks for tags on your page, it first checks for the Twitter property, and if not present, falls back to the supported Open Graph property. This allows for both to be defined on the page independently, and minimizes the amount of duplicate markup required to describe your content and experience.

Note that while Open Graph recommends specifying the "og" RDFa Core 1.1 CURIE prefix mapping via <html prefix="og: ogp.me/ns#">, no such markup is required for Twitter cards and its use of the "twitter:" prefix in a HTML meta element's name attribute. Open Graph protocol also specifies the use of property and content attributes for markup (example.com/ogp.jpg"/>) while Twitter cards use name and content. Twitter's parser will fall back to using property and content, so there is no need to modify existing Open Graph protocol markup if it already exists in your page.

The example below uses a mix of Twitter and Open Graph tags to define a summary card:

<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@nytimesbits">
<meta name="twitter:creator" content="@nickbilton">
<meta property="og:url" content="bits.blogs.nytimes.com/2011/12/08/a-twitter-for-my-sister/">
<meta property="og:title" content="A Twitter for My Sister">
<meta property="og:description" content="In the early days, Twitter grew so quickly that it was almost impossible to add new features because engineers spent their time trying to keep the rocket ship from stalling.">
<meta property="og:image" content="graphics8.nytimes.com/images/2011/12/08/...tter-tmagArticle.jpg">

The topic has been locked.
Active Subscriptions:

None
11 years 10 months ago - 11 years 10 months ago #45634 by alechu
this is need for analytics.twitter.com/

@my_site does not have access to Twitter Analytics. If you're a publisher, developer, or advertiser, learn how to get access.

Setting up Twitter Card analytics

Implement Twitter Cards.

Apply for approval of your cards.

Tweet links to your content. Analytics will be available in 24 hours.

Alternatively, if you’d like to track Tweets, impressions, clicks, and Retweets of your content prior to implementing Twitter Cards, you can skip the steps above and simply do the following:

Add the following meta tag to your web pages:
<meta name=”twitter:site” content=”@yourusername”>
Tweet links to your content (note that they will not have Twitter Cards attached to them without the full set of markup). Analytics will be available in 24 hours.

Using Twitter Card analytics

Twitter Card analytics will be available to your primary account and other Twitter accounts to which you grant access. Allowing Analyst access (or greater) for a Twitter account will enable viewing of all analytics dashboards.

To enable Analyst access for an account, follow these steps from your primary account:

Log in to the primary account.

In the Accounts drop-down, select “Edit access to account.”

Click “Add more users.”

Enter the account @ username and set the preferred level of access.
Last edit: 11 years 10 months ago by alechu.
The topic has been locked.
Support Specialist
11 years 10 months ago #45653 by alzander
We're planning deeper Twitter Card support later this year. Right now, we support only the Summary card (the default, recommended Card type). We'll have more options for setting Twitter card settings, like "site" and "creator" sitewide later on, along with options for overriding the tags on a per-page basis, similar to what we have with Open Graph tags right now.

If you want help forcing the creator and site tags on your site for all pages, we can help with that right now as it's just a few lines of code. It's more difficult if you need control over those tags on a per-page basis.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 10 months ago #45689 by alechu

alzander wrote: We're planning deeper Twitter Card support later this year. Right now, we support only the Summary card (the default, recommended Card type). We'll have more options for setting Twitter card settings, like "site" and "creator" sitewide later on, along with options for overriding the tags on a per-page basis, similar to what we have with Open Graph tags right now.

If you want help forcing the creator and site tags on your site for all pages, we can help with that right now as it's just a few lines of code. It's more difficult if you need control over those tags on a per-page basis.

Thanks,
Alex


this is good!

now i need only 1 tag:

<meta name=”twitter:site” content=”@yourusername”>

for Twitter analytics! plz add this tag for next version!
The topic has been locked.
Support Specialist
11 years 10 months ago #45702 by alzander
To add that tag now, edit the /libraries/sourcecoast/openGraph.php file. Around line 298, you'll see:
// Basic Twitter Card support
            if($this->name == 'og:title')
                $graphValue .= '<meta name="twitter:title" content="' . $tagValue . '"/>' . CARRIAGE_RETURN;
Update that to:
// Basic Twitter Card support
            if($this->name == 'og:title')
            {
                $graphValue .= '<meta name="twitter:title" content="' . $tagValue . '"/>' . CARRIAGE_RETURN;
                $graphValue .= ' <meta name=”twitter:site” content=”@yourusername”>' . CARRIAGE_RETURN;
            }
That should get you going for now. Please let me know if that helps do what you're looking for.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 10 months ago #45728 by alechu

alzander wrote: To add that tag now, edit the /libraries/sourcecoast/openGraph.php file. Around line 298, you'll see:

// Basic Twitter Card support
            if($this->name == 'og:title')
                $graphValue .= '<meta name="twitter:title" content="' . $tagValue . '"/>' . CARRIAGE_RETURN;
Update that to:
// Basic Twitter Card support
            if($this->name == 'og:title')
            {
                $graphValue .= '<meta name="twitter:title" content="' . $tagValue . '"/>' . CARRIAGE_RETURN;
                $graphValue .= ' <meta name=”twitter:site” content=”@yourusername”>' . CARRIAGE_RETURN;
            }
That should get you going for now. Please let me know if that helps do what you're looking for.

Thanks,
Alex

this code not work! when i'm add this code, i just see blank:page (white page). i'm no can see site, if i add this code.
The topic has been locked.
Support Specialist
11 years 10 months ago #45741 by alzander
The code above is correct. Can you post the block of code after you edited it with your username or whatever other changes you made?

One other thing to try is setting Error Reporting to 'maximum' in the Joomla -> Global Configuration area. That may show a real PHP error message explaining what's wrong.

Thanks,
Alex
The topic has been locked.
Support Specialist
11 years 10 months ago #45742 by alzander
Actually, looking at my post, it does look like the double-quote mark may have been changed to some fancy quotation mark. Please try to erase and replace the " symbols in the new line you added to make sure they are real, basic, double-quotes.

Hopefully, that's all it is.

Thanks,
Alex
The topic has been locked.