# GetSocialPublishURLByName()

Returns HTML code for sharing a content region on a supported social network. Use this function with the Social Forward feature of Marketing Cloud Engagement.

## Availability

<table>
  <tr>
    <td>Marketing Cloud Engagement</td>
    <td>✅ Yes</td>
  </tr>
  <tr>
    <td>Marketing Cloud Next</td>
    <td>❌ No</td>
  </tr>
</table>

## Syntax

```
GetSocialPublishURLByName(socialNetworkName,
                          countryCode, contentRegion,
                          socialNetworkParamKey, socialNetworkParamValue)
```

The `GetSocialPublishURLByName()` function has five parameters:

- `socialNetworkName` (string): Required. The name of the social network.
- `countryCode` (string): Required. An ISO country code.
- `contentRegion` (string): Required. The name of the content region to share on the social network.
- `socialNetworkParamKey` (string): The key of a parameter to pass to the target social network.
- `socialNetworkParamValue` (string): The value of a parameter to pass to the target social network.

You can pass multiple key-value pairs for parameters by appending them to the end of the function.

## Supported Social Networks

This function supports these social networks.

:::note
This list includes several social media sites that are no longer active as of 2023. This list is provided for completeness.
:::

- Del.icio.us
- Digg
- Facebook
- Google
- Google+
- LinkedIn
- Microsoft
- MySpace
- ShareThis
- StumbleUpon
- Twitter
- Yahoo

## Usage

```
<!-- RegionStart[ name:'Shared content region 1',
title:'First shared email content',
description:'This is an example of shared content',
csskey:'portfolio css 1'] -->
<tablewidth='100%'bgcolor='#FFFFFF'border='0'bordercolor=''cellpadding='5'cellspacing='0'>
<tr>
<tdstyle='font-family:Arial; font-size:13px'>
<imgsrc='http://example.com/images/logo.jpg' title='logo'align='left'border='0'/>
<p id='text-placeholder'style='margin-top: 0px; margin-bottom: 0px;'>This is an example of a shared content area!&amp;nbsp; Please feel free to pass on this information!<br/>
<br/></p>
<!-- Creates a link to share this content with facebook -->
<a href='%%=GetSocialPublishURLByName('Facebook','US','Shared content region 1')=%%' alias='Social Forward to Facebook' title='Publish to Facebook'>
<img src='http://images.dev2.et.local/lib/ffcf14/m/1/social_default_facebook_icon.jpg' alt='Facebook' title='Facebook' border='0'></a>
</td>
</tr>
</table>
<!-- RegionEnd[ name:'Shared content region 1'] -->
```

## See Also

- [Social Forward](https://help.salesforce.com/s/articleView?id=mktg.mc_es_social_forward.htm)
- [GetSocialPublishUrl()](/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-social/mc-ampscript-reference-social-get-social-publish-url.md)
