top of page
Sxgram Logos
Add the Sxgram logo to your Social Share Bar and introduce your network to the first social platform for adults.
Get Started!
Simply Copy & Paste this API Code to your website:
<!-- ============================================
SXGRAM SHARE BUTTON
https://www.sxgram.com
============================================ -->
<a
class="sxgram-share-button"
href="#"
aria-label="Share on Sxgram"
title="Share on Sxgram"
style="
display:inline-flex;
align-items:center;
justify-content:center;
text-decoration:none;
line-height:0;
"
>
<img
src="PASTE_YOUR_PUBLIC_SXGRAM_SVG_URL_HERE"
alt="Share on Sxgram"
width="32"
height="32"
style="
display:block;
width:32px;
height:32px;
object-fit:contain;
border:0;
"
>
</a>
<script>
(function () {
/* ============================================
SXGRAM SETTINGS
============================================ */
const SXGRAM_SHARE_URL =
"https://www.sxgram.com/share";
/* ============================================
OPTIONAL GOAFFPRO AFFILIATE CODE
============================================ */
const SXGRAM_AFFILIATE_CODE =
"";
/* ============================================
CLEAN VALUE
============================================ */
function clean(value) {
if (
value === null ||
value === undefined
) {
return "";
}
return String(value).trim();
}
/* ============================================
READ PAGE META TAGS
============================================ */
function getMetaContent(
selectors
) {
for (
const selector
of selectors
) {
const element =
document.querySelector(
selector
);
if (
element &&
clean(
element.content
)
) {
return clean(
element.content
);
}
}
return "";
}
/* ============================================
ABSOLUTE URL
============================================ */
function makeAbsoluteUrl(
value
) {
const url =
clean(
value
);
if (!url) {
return "";
}
try {
return new URL(
url,
window.location.href
).toString();
} catch (_) {
return url;
}
}
/* ============================================
CURRENT PAGE URL
============================================ */
function getPageUrl() {
const canonical =
document.querySelector(
'link[rel="canonical"]'
);
if (
canonical &&
clean(
canonical.href
)
) {
return makeAbsoluteUrl(
canonical.href
);
}
return window.location.href;
}
/* ============================================
PAGE TITLE
============================================ */
function getPageTitle() {
return (
getMetaContent([
'meta[property="og:title"]',
'meta[name="twitter:title"]'
])
||
clean(
document.title
)
||
"Shared page"
);
}
/* ============================================
PAGE DESCRIPTION
============================================ */
function getPageDescription() {
return getMetaContent([
'meta[property="og:description"]',
'meta[name="twitter:description"]',
'meta[name="description"]'
]);
}
/* ============================================
PAGE IMAGE
============================================ */
function getPageImage() {
const image =
getMetaContent([
'meta[property="og:image"]',
'meta[property="og:image:secure_url"]',
'meta[name="twitter:image"]',
'meta[property="twitter:image"]'
]);
return makeAbsoluteUrl(
image
);
}
/* ============================================
BUILD SXGRAM SHARE URL
============================================ */
function buildShareUrl() {
const shareURL =
new URL(
SXGRAM_SHARE_URL
);
/* ------------------------------------------
ORIGINAL PAGE URL
------------------------------------------ */
shareURL.searchParams.set(
"url",
getPageUrl()
);
/* ------------------------------------------
TITLE
------------------------------------------ */
const title =
getPageTitle();
if (title) {
shareURL.searchParams.set(
"title",
title
);
}
/* ------------------------------------------
DESCRIPTION
------------------------------------------ */
const description =
getPageDescription();
if (description) {
shareURL.searchParams.set(
"description",
description
);
}
/* ------------------------------------------
IMAGE
------------------------------------------ */
const image =
getPageImage();
if (image) {
shareURL.searchParams.set(
"image",
image
);
}
/* ------------------------------------------
OPTIONAL AFFILIATE CODE
------------------------------------------ */
if (
SXGRAM_AFFILIATE_CODE
) {
shareURL.searchParams.set(
"ref",
SXGRAM_AFFILIATE_CODE
);
}
return shareURL.toString();
}
/* ============================================
SHARE TO SXGRAM
============================================ */
function shareToSxgram(
event
) {
event.preventDefault();
const destination =
buildShareUrl();
window.open(
destination,
"_blank",
"noopener,noreferrer"
);
}
/* ============================================
INITIALIZE BUTTON
============================================ */
const buttons =
document.querySelectorAll(
".sxgram-share-button"
);
buttons.forEach(
function(button) {
button.addEventListener(
"click",
shareToSxgram
);
}
);
})();
</script>
OR...
Earn money with each referral!
Sign up for our Affiliate Program and earn 70%! Then, simply link your affiliate URL to the Sxgram logos on your site and start earning every time your network joins Sxgram!
Don't have an account? Signup Here
Get Started!
Step 1 - Create your Affiliate Account: Click Here
Step 2 - Paste your GoAffPro affiliate URL:
Step 3 - Copy & Paste Your Custom API Code
Sign up for our Affiliate Program and earn 70%! Then, simply link your affiliate URL to the Sxgram logos on your site and start earning every time your network joins Sxgram!
bottom of page
























