ATG On Social Network FaceBook/Twitter Integration

How about using social networking sites as a channel to sell our
products ?

Yes,we can share the Product/Sku Infromation  to any social networking sites. So anybody interested can access the URL and see the Products/Skus,Browse Catalogs and place orders through this channel

I have successfully integrated our code with the  below social networking sites.

1.Facebook

2.Twitter

This can be done basically by posting a link to Twitter or FaceBook and upon clicking the URL,this will redirect you back to the Product Catalog page of your Site.

ATG FaceBook Integration


I registered the URL with tinyUrl(www.tinyurl.com),as this option helps to cut short  big URL to  rather simpler one.

Below is the code snippet.
You just need to place this in your JSP files,dont forget to
create the image file for this.

<a target="_blank" href=http://www.facebook.com/sharer.php?

  url=${tinyUrl}" onclick="window.open(this.href,'','toolbar=0,
  resizable=yes, scrollbars=yes,
 
 status=0,width=600, height=430' );return false;">
  <img title="Add to Facebook" alt="Facebook" 
  src="images/facebook.gif" 
  style="width: 14px; height: 14px; border:0"> 
</a>


You can add your custom message in the text box provided above,
the message and the link will be posted to your wall after
clicking the 'Share Link' button

ATG Twitter Integration    
     
 
<a target="_blank" href="http://www.twitter.com/home?${tinyUrl}"
 
 onclick="window.open(this.href,'','toolbar=0, resizable=yes,
  scrollbars=yes,status=0, width=600, height=300' );return false;">
  <img title="Tweet this" alt="Twitter" src="images/twitter.gif"
  style="border:0" />
</a>

For Dynamically generate tinyUrl from your application,create a droplet and set the value tinyUrl in the request parameter.

Make sure you have the necessary ports opened to access the website URL.

Code

URL url = new URL("http://tinyurl.com/api-create.php?url=" + origUrl);
URLConnection connection = url.openConnection(); 
....Read the Generated tiny URL through BufferedReader and
set it to request parameter as below.
pRequest.setParameter("tinyUrl", tinyUrl);
pRequest.serviceLocalParameter("output", pRequest, pResponse);

FaceBook Sharer Image

Facebook Sharer Popup Page


Comments

  1. Hi,
    Have you integrated the fb login functionality in ATG application?
    I am using the facebook sdk for taht but unable to connect this login functionality with atg profile.
    As a result if user id logged in as facebook credential his session is not remain same till end.

    ReplyDelete
  2. Nope,i have integrated only the share functionality through which we can share the Product/Sku information.

    ReplyDelete

Post a Comment

Popular posts from this blog

BCC site status inaccessible Agent Production in error state

Weblogic Issues during EAR Deployment Exception in AppMerge flows progression

Add a shopping cart button to the product page