GetSocialPublishURL()

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

GetSocialPublishURL(socialNetworkCode,
                    contentRegion,
                    socialNetworkParamKey,
                    socialNetworkParamValue)

The GetSocialPublishURL() function has five parameters:

  • socialNetworkCode (string): Required. The name of the social network.
  • 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

Pass a number from the Number Code column as the first parameter in the function.

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

Social Network Number Code
Facebook 1
Del.icio.us 2
Digg 3
MySpace 4
StumbleUpon 5
Google 6
Microsoft 7
Yahoo 8
LinkedIn 9
ShareThis 10
Twitter 11
Google+ 15

Usage

In the pasted HTML code below, the GetSocialPublishURL() function creates a link to Facebook in order to share the specified content area on that network.

<!-- 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='%%=GetSocialPublishURL('1','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