Skip to main content

Social actions

Overview

We suggest using social actions for audience multiplication — share, post and invite friends to the game. Platforms such as VK and OK allow you to use the tools built into the platform. The rest of the platforms will imitate the functionality through the usual link sharing with the ability to add a comment and sometimes pictures.

The list of supported social networks and messengers for sharing:

  • Facebook
  • Whatsapp
  • Telegram
  • Vkontakte
  • Twitter
  • Odnoklassniki
  • Viber

For better parsing of games by messengers and social networks, we recommend placing Open Graph meta tags in the game. And also fill in the title and description. This is useful in terms of SEO optimization. An example of placing meta tags is shown below:

// Fill in the basic information about the game
<title>My awesome game 2</title>
<meta name="og:title" content="My awesome game 2">
<meta name="description" content="There are not enough words to describe the awesomeness of the game">
<meta name="og:description" content="There are not enough words to describe the awesomeness of the game">
<meta name="og:image" content="/img/ogimage.png">

Supported platforms

  • CrazyGames
  • Yandex Games
  • VK Games
  • VK Play
  • OK Games
  • GameMonetize
  • GamePix
  • Platforms without support
  • GameDistribution
  • SmartMarket
  • WG Playground
  • Kongregate
  • To check that sharing is allowed and supported on the platform:

    // Is sharing supported
    gp.socials.isSupportsShare;

    Share

    FREE

    By default, when calling the share method, you can share a link to the game. We will determine the link ourselves based on the platform and insert the necessary text. The text is taken from the project name in the control panel or from the og:title meta tag or simply from the title tag.

    Platforms with native functionality

  • VK Games
  • OK Games
  • Platforms without support
  • CrazyGames
  • GamePix
  • GameDistribution
  • GameMonetize
  • SmartMarket
  • VK Play
  • Yandex Games
  • WG Playground
  • Kongregate
    // Is native sharing supported
    gp.socials.isSupportsNativeShare;

    In platforms without native support for this method, there will be used an overlay with an offer to share on social networks and messengers.

    gp.socials.share();

    Share with free text adding:

    gp.socials.share({
    text: `I tapped the square 73 times in 5 seconds!
    Now I am number 23 in "Fastest Fingers" list.
    Can you beat out me?`,
    });

    Share with an arbitrary link adding:

    gp.socials.share({
    url: `${gp.app.url}?invitedBy=${gp.player.id}`,
    });

    Share with an optional picture adding:

    gp.socials.share({
    image: 'https://gamepush.com/img/ogimage.png',
    });
    info

    Support for images through native methods of social networks is implemented only in Vkontakte through the attachment format photo123456_123456 and Odnoklassniki through the attachment format 123456, or URL of images uploaded through GamePush to the platform (gp.images.upload()) for the rest, the image parameter will be ignored, only url and text are available.

    Fully customizable sharing:

    gp.socials.share({
    text: 'Join me in the game "My awesome game 2"',
    url: gp.app.url,
    image: 'https://gamepush.com/img/ogimage.png',
    });

    You can subscribe to on share event:

    gp.socials.on('share', (success) => {
    // success = true if successful share
    });

    Post

    FREE

    As opposed to share method, the post method involves posting to the player’s friends news feed.

    Platforms with native functionality

  • VK Games
  • OK Games
  • Platforms without support
  • CrazyGames
  • GamePix
  • GameDistribution
  • GameMonetize
  • SmartMarket
  • VK Play
  • Yandex Games
  • WG Playground
  • Kongregate
    // Is native posting supported
    gp.socials.isSupportsNativePosts;

    On the platforms without native supporting for this method, there will be used an overlay with an offer to share, as in the case of the share method.

    The usage logic duplicates the share method.

    gp.socials.post();

    Fully customizable post:

    gp.socials.post({
    text: 'Join me in the game "My awesome game 2"',
    url: gp.app.url,
    image: 'https://gamepush.com/img/ogimage.png',
    });

    You can subscribe to on post event:

    gp.socials.on('post', (success) => {
    // success = true if successful post
    });

    Invite friends

    FREE

    Shows the player a friends list to whom you can send the invitation.

    Platforms with native functionality

  • VK Games
  • OK Games
  • Platforms without support
  • CrazyGames
  • GamePix
  • GameDistribution
  • GameMonetize
  • SmartMarket
  • VK Play
  • Yandex Games
  • WG Playground
  • Kongregate
    // Are native invites supported
    gp.socials.isSupportsNativeInvite;

    On the platform without native supporting of this method, there will be used an overlay with the offer to invite friends, as in the case of share and post methods.

    The usage logic duplicates the share method.

    gp.socials.invite();

    Customizable text for some platforms:

    gp.socials.invite({
    text: 'Join me in the game "My awesome game 2"',
    });

    You can subscribe to on invite event:

    gp.socials.on('invite', (success) => {
    // success = true if successful invite
    });
    tip

    The method accepts the same object as in the case of share and post, but today only text is used.

    Join community

    FREE

    Shows the player an overlay with the opportunity to join the community (if the platform allows) or opens a link to the community in a new tab.

    Supported platforms

  • CrazyGames
  • Yandex Games
  • VK Games
  • OK Games
  • GameMonetize
  • SmartMarket
  • Platforms without support
  • GamePix
  • GameDistribution
  • VK Play
  • WG Playground
  • Kongregate
    // check is community join is available on platform
    gp.socials.canJoinCommunity;

    Platforms with native functionality

  • VK Games
  • OK Games
  • Platforms without support
  • CrazyGames
  • GamePix
  • GameDistribution
  • GameMonetize
  • SmartMarket
  • VK Play
  • Yandex Games
  • WG Playground
  • Kongregate
    // check is native community join is supported
    gp.socials.isSupportsNativeCommunityJoin;

    Join community:

    gp.socials.joinCommunity();

    You can subscribe to on join community event:

    gp.socials.on('joinCommunity', (success) => {
    // success = true if successful join community
    });

    Working with parameters for sharing

    You may need to create a link to invite a player that contains the inviter's ID and a gift for the invited player. To do this, you need to add these parameters to the game link on the platform. All platforms require different ways of forming URLs. We have combined the creation of links into one method. When you follow this link, all previously passed parameters are available to you.

    FREE
    const shareUrl = gp.socials.makeShareUrl({
    // any of your parameters
    fromId: gp.player.id,
    gift: 'GOLD_SWORD_X5',
    });
    // https://vk.com/app7869399#eyJmcm9tSWQiOjE4MDcwMTksImdpZnQiOiJHT0xEX1NXT1JEX1g1In0=
    FREE
    // any of your parameters specified in the link
    const fromId = gp.socials.getShareParam('fromId'); // 123456
    const gift = gp.socials.getShareParam('gift'); // "GOLD_SWORD_X5"

    Stay in Touch

    Other documents of this chapter available Here. To get started, welcome to the Tutorials chapter.

    GamePush Community Telegram: @gs_community.

    For your suggestions e-mail: [email protected]

    We Wish you Success!