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.

Note: For more details about this implementation, contact your Oracle Infinity solutions consultant.

Plugin loading workflow

  1. 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.
  2. 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.
  3. Once the plugin has loaded and the window.twttr object appears, polling will complete and the plugin creates listeners for Twitter events.
  4. 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.

EventBound?Description
clickYThis 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.
followYWhen visitor clicks to follow another user
likeYWhen a visitor clicks to like a tweet
loadedNEmitted when the plugin is finished rendering widgets and loading
renderedNTriggered on each web widget render
retweetYWhen visitor clicks to retweet
tweetYTriggered 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.

ParameterDefault valueDescription
blockCollectfalseThis value has to be set to true to allow time for plugin polling.
enabletrueEnable plugin functionality. Meant more as a switch to disable the plugin if needed.
inTestfalseExpose internal methods for testing via window.wt.plugins.TW._test_.
iPollFreq300The frequency at which to poll for Twitter events
timeout4000The 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.

ParameterTracked onExampleDescription
wt.dlAlways111The type of event
For page views, it is set to 0. A social conversion always has a value of 111.
wt.soc_actionSocial actionTwitter:LikeThe name of the social action
wt.soc_contentSocial actionURL/username/tweetID/etc.Social action-specific content (depending on the action)
wt.tw_hashtagSocial actionTwitterStoriesContains the hash tag preset for a tweet with #hashTag
wt.tw_intentSocial actiontweetMentionHeuristically-determined type of intent (plugin-specific)
wt.tw_jsAlways1
  • 0: No Twitter widgets JavaScript was detected when plugin was loading.
  • 1: Twitter widgets JavaScript is loaded (window.twttr is available).
wt.tw_plverAlways1.0.0Twitter plugin version
wt.tw_regionSocial actiontweetcount, follow, screen_nameExtended detail indicating where in a Twitter widget the event originated
wt.tw_srctweetidSocial action463440424141459456For specific events, the ID of a tweet post that was retweeted via a web widget (not intents)
wt.tw_timeoutAlways11: Timed out while waiting for Twitter widgets JavaScript to load
wt.tw_tweetidSocial action463440424141459456For specific events, the ID of a tweet post on which action was taken
wt.tw_usridSocial action3308337For specific events, the ID of the Twitter user who's profile the visitor intends to view
wt.tw_usrscrnameSocial actionInteriorFor specific events, the screen name of the user that the visitor started following (not our visitor name)
wt.tw_wdgidSocial action698123635282804738For 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 typewt.soc_actionwt.soc_content
Button: tweetTwitter: tweetURL
Button: hash tagTwitter: tweet hash tagURL
Button: mentionTwitter: tweet toUser name
Button: followTwitter: followUser name
Intent: likeTwitter: likeTweet ID
Intent: tweetTwitter: tweetURL
Intent: reply (specific tweet)Twitter: reply toTweet ID
Intent: retweet (specific tweet)Twitter: retweetTweet ID
Intent: display userTwitter: display userUser name
Intent: follow userTwitter: followUser name

Learn more

Infinity Module Plugins

JavaScript Interfaces for Twitter for Websites @ Twitter Developers

Twitter scripting events

Twitter for websites