Content widget

Only public content is supported with this widget at the moment. You group must be open for joining. User’s profile must be public

With this widget, you can advertise any content of your group / profile on Odnoklassniki.

Following content types are available for sharing by a direct link:

  • group and user topics;
  • group and user photos.

Any other type of content (i.e. video, music) must be posted as a topic first.

Content url

Width




Result

Code to insert

How to get a publication link:

  1. Go to group’s or user’s page.
  2. Open the publication / photo by clicking on it.
  3. Copy the link from the browser address line and paste it into the widget embed code.

Group join event tracking:

If you publish any group content with this widget users can join your group via it. After a join a postMessage with following data is sent to your page:

ok_join$__okContent1

You can track event on page with widget by the following javascript code:

function listenForJoin() {
    if (window.addEventListener) {
        window.addEventListener('message', onJoin, false);
    } else {
        window.attachEvent('onmessage', onJoin);
    }
}

function onJoin(e) {
    var args = e.data.split("$");
    if (args[0] == "ok_join") {
        alert(args[1]);
    }
}

listenForJoin();

User subscription event tracking:

If you publish any user content with this widget other users can subscribe to you via it. After a subscription a postMessage with following data is sent to your page:

ok_subscribe$__okContent1

You can track event on page with widget by the following javascript code:

function listenForJoin() {
    if (window.addEventListener) {
        window.addEventListener('message', onSubscribe, false);
    } else {
        window.attachEvent('onmessage', onSubscribe);
    }
}

function onSubscribe(e) {
    var args = e.data.split("$");
    if (args[0] == "ok_subscribe") {
        alert(args[1]);
    }
}

listenForJoin();