Twitter Data Collection Plugin
This plugin helps to track visitor intents on Twitter widgets and intent links.
Twitter for Websites JavaScript (TWWJS) provides an interface for easily binding and listening to Twitter events, to which the plugin assigns listeners to when loading. The interface is available globally via window.twttr.events
.
Plugin loading workflow
- Availability of
window.twttr
is checked and if it is not yet available then polling begins with default polling frequency of 300 ms. This value is configurable via Oracle Infinity Support. - The polling has a default timeout value of 4000 ms, which is the same as the default tracking pipeline timeout. This value is configurable via Oracle Infinity Support.
- Once the plugin has loaded and the
window.twttr
object appears, polling will complete and the plugin creates listeners for Twitter events. - The plugin then notifies the parent Infinity module that it is ready.
Tracked Twitter events
The following native Twitter event types can be bound and listened for via this plugin interface. The plugin binds only to those that are triggered on visitor actions (intents). Other events like loaded and rendered often occur before plugin has loaded and are therefore are ignored.
Event | Bound? | Description |
---|---|---|
click | Y | This event is always triggered first and together with any of the events. For example, when a visitor clicks on any of the Twitter widgets or intended actions, there is a click event followed by tweet. There are two events on each visitor action on a Twitter widget. This event is used only for intended actions that does not trigger any of the follow-up below events, such as display user. |
follow | Y | When visitor clicks to follow another user |
like | Y | When a visitor clicks to like a tweet |
loaded | N | Emitted when the plugin is finished rendering widgets and loading |
rendered | N | Triggered on each web widget render |
retweet | Y | When visitor clicks to retweet |
tweet | Y | Triggered on tweet, reply to, and related events |
Note: All of the Twitter events signify only the visitor's intent to do something, such as follow. They do not mean that the visitor followed through to complete the action.
Plugin configuration
The plugin has a few configuration settings that can be set by Oracle Infinity Support.
Parameter | Default value | Description |
---|---|---|
blockCollect | false | This value has to be set to true to allow time for plugin polling. |
enable | true | Enable plugin functionality. Meant more as a switch to disable the plugin if needed. |
inTest | false | Expose internal methods for testing via window.wt.plugins.TW._test_ . |
iPollFreq | 300 | The frequency at which to poll for Twitter events |
timeout | 4000 | The value from the tracking pipeline timeout, which is the time given for the plugin to load and add mutations in time for a page view. |
Example
...
"wt-plugins" : {
"tw" : {
"enable": true,
"timeout": 4000,
"iPollFreq": 300,
"blockCollect" : true,
"timeout" : 4000,
"inTest" : false
}
}
...
Tracked analytics parameters
Most of the parameters are tracked either on page view, social action or both.
Parameter | Tracked on | Example | Description |
---|---|---|---|
wt.dl | Always | 111 | The type of event For page views, it is set to 0 . A social conversion always has a value of 111 . |
wt.soc_action | Social action | Twitter:Like | The name of the social action |
wt.soc_content | Social action | URL/username/tweetID/etc. | Social action-specific content (depending on the action) |
wt.tw_hashtag | Social action | TwitterStories | Contains the hash tag preset for a tweet with #hashTag |
wt.tw_intent | Social action | tweetMention | Heuristically-determined type of intent (plugin-specific) |
wt.tw_js | Always | 1 |
|
wt.tw_plver | Always | 1.0.0 | Twitter plugin version |
wt.tw_region | Social action | tweetcount , follow , screen_name | Extended detail indicating where in a Twitter widget the event originated |
wt.tw_srctweetid | Social action | 463440424141459456 | For specific events, the ID of a tweet post that was retweeted via a web widget (not intents) |
wt.tw_timeout | Always | 1 | 1 : Timed out while waiting for Twitter widgets JavaScript to load |
wt.tw_tweetid | Social action | 463440424141459456 | For specific events, the ID of a tweet post on which action was taken |
wt.tw_usrid | Social action | 3308337 | For specific events, the ID of the Twitter user who's profile the visitor intends to view |
wt.tw_usrscrname | Social action | Interior | For specific events, the screen name of the user that the visitor started following (not our visitor name) |
wt.tw_wdgid | Social action | 698123635282804738 | For specific events, the ID of an embedded Twitter widget on which the action occurred |
Twitter widget types and Infinity tag social action and content
The following table maps Twitter widget types to the Infinity Tag's wt.soc_action
and wt.soc_content
that are used to detect the intended user action.
Twitter widget type | wt.soc_action | wt.soc_content |
---|---|---|
Button: tweet | Twitter: tweet | URL |
Button: hash tag | Twitter: tweet hash tag | URL |
Button: mention | Twitter: tweet to | User name |
Button: follow | Twitter: follow | User name |
Intent: like | Twitter: like | Tweet ID |
Intent: tweet | Twitter: tweet | URL |
Intent: reply (specific tweet) | Twitter: reply to | Tweet ID |
Intent: retweet (specific tweet) | Twitter: retweet | Tweet ID |
Intent: display user | Twitter: display user | User name |
Intent: follow user | Twitter: follow | User name |
JavaScript Interfaces for Twitter for Websites @ Twitter Developers