This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with Link Metrics
Overview
The following operations allow you to work with Link Metrics . Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with Link Metrics , see Sample configuration.
Operation | Description |
---|---|
Returns the number of clicks on a single bitly link. | |
getLinkCountries | Returns metrics about the countries referring click traffic to a single bitly link. |
getLinkReferringDomain | Returns metrics about the domains referring click traffic to a single bitly link. |
getLinkShares | Returns metrics about a shares of a single link. |
Operation details
This section provides further details on the operations related to Link Metrics.
Get a bitly short URL
The
getLinkClicks
operation returns the number of clicks on a single bitly link .
<bitly.getLinkClicks> <urlforLinkCkick>{$ctx:urlforLinkCkick}</urlforLinkCkick> </bitly.getLinkClicks>
Properties
urlforLinkCkick:
a Bitly link
Sample request
Following is a sample REST/JSON request that can be handled by the getLinkClicks
operation.
{ "urlforLinkCkick":"http://bit.ly/1sOskGp" }
Related Bitly documentation
http://dev.bitly.com/link_metrics.html#v3_link_clicks
Get metrics about the countries referring click traffic to a single bitly link .
The getLinkCountries
operation returns metrics about the countries referring click traffic to a single bitly link .
<bitly.getLinkCountries> <urlforLinkCountry>{$ctx:urlforLinkCountry}</urlforLinkCountry> </bitly.getLinkCountries>
Properties
urlforLinkCountry
: a Bitly link
Sample request
Following is a sample REST/JSON request that can be handled by the getLinkCountries
operation.
{ "urlforLinkCountry":"http://bit.ly/1sOskGp" }
Related Bitly documentation
http://dev.bitly.com/link_metrics.html#v3_link_countries
Get metrics about the domains referring click traffic to a single bitly link
The
getLinkReferringDomains
operation returns metrics about the domains referring click traffic to a single bitly link .
<bitly.getLinkReferringDomains> <urlforReferringDomain>{$ctx:urlforReferringDomain}</urlforReferringDomain> </bitly.getLinkReferringDomains>
Properties
urlforReferringDomain: a Bitly link.
Sample request
Following is a sample REST/JSON request that can be handled by the
getLinkReferringDomains
operation.
{ "urlforReferringDomain":"http://bbc.in/1i0aaNh" }
Related Bitly documentation
http://dev.bitly.com/link_metrics.html#v3_link_referring_domains
Get metrics about a shares of a single link.
The
getLinkShares
operation returns metrics about a shares of a single link. .
<bitly.getLinkShares> <urlforLinkShares>{$ctx:urlforLinkShares}</urlforLinkShares> </bitly.getLinkShares>
Properties
urlforLinkShares: a Bitly link.
Sample request
Following is a sample REST/JSON request that can be handled by the
getLinkShares
operation.
{ "urlforLinkShares":"http://www.myfootballgames.co.uk/game/353/World-Cup-Penalty.html" }
Related Bitly documentation
http://dev.bitly.com/links.html#v3_user_link_save
Sample request
Following is a sample REST/JSON request that can be handled by the
getLookup
operation.
{ "urlforLookup":"http://google.com/" }
Related Bitly documentation
Sample configuration
Following is a sample proxy service that illustrates how to connect to Bitly with the init
operation and use the getLinkClicks
operation. The sample request for this proxy can be found in getLinkInfo sample request.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="bitly" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence onError="faultHandlerSeq"> <property name="accessToken" expression="json-eval($.accessToken)"/> <property name="bitlyLink" expression="json-eval($.bitlyLink)" /> <bitly.init> <accessToken>{$ctx:accessToken}</accessToken> </bitly.init> <bitly.getLinkClicks> <urlforLinkCkick>{$ctx:urlforLinkCkick}</urlforLinkCkick> </bitly.getLinkClicks> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>