<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>gj |</title>
	<atom:link href="https://blog.gaiterjones.com/category/social-media-marketing/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.gaiterjones.com/category/social-media-marketing/</link>
	<description>gaiterjones</description>
	<lastBuildDate>Mon, 13 May 2013 14:40:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.3</generator>
	<item>
		<title>Automatically Tweet New Magento Products</title>
		<link>https://blog.gaiterjones.com/automatically-tweet-new-magento-products/</link>
					<comments>https://blog.gaiterjones.com/automatically-tweet-new-magento-products/#respond</comments>
		
		<dc:creator><![CDATA[PAJ]]></dc:creator>
		<pubDate>Tue, 06 Nov 2012 15:35:01 +0000</pubDate>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[marketing tweets]]></category>
		<category><![CDATA[Social Media Marketing]]></category>
		<category><![CDATA[Twitter]]></category>
		<guid isPermaLink="false">http://blog.gaiterjones.com/?p=855</guid>

					<description><![CDATA[This is a PHP application I developed to automatically Tweet Magento products set with the New From date attribute. https://github.com/gaiterjones/magento-tweetproducts Magento Product Tweet v0.5x &#160; Introduction Prerequisites Installation Configuration Usage...<a class="more-link" href="https://blog.gaiterjones.com/automatically-tweet-new-magento-products/" title="Continue reading">Continue reading</a>]]></description>
										<content:encoded><![CDATA[<p>This is a PHP application I developed to automatically Tweet Magento products set with the New From date attribute.</p>
<p><a href="https://github.com/gaiterjones/magento-tweetproducts" target="_blank">https://github.com/gaiterjones/magento-tweetproducts</a></p>
<p><strong>Magento Product Tweet v0.5x</strong></p>
<p>&nbsp;</p>
<ol>
<li>Introduction</li>
<li>Prerequisites</li>
<li>Installation</li>
<li>Configuration</li>
<li>Usage</li>
</ol>
<p>&nbsp;</p>
<p><strong>Introduction</strong></p>
<p>&nbsp;</p>
<p>Magento Product Tweet is an object oriented PHP script that integrates with a Magento installation to automatically tweet product information for new products set with the New From date attribute in the Magento database.</p>
<p>&nbsp;</p>
<p>Magento Product Tweet works with Magento Community Edition version 1.4 or greater and requires PHP 5.3 or greater.</p>
<p>&nbsp;</p>
<p><strong>Prerequisites</strong></p>
<p>&nbsp;</p>
<p>This application requires a configured Twitter Account and configured Twitter application for the account as well as a Bitly API key to generate short urls.</p>
<p>&nbsp;</p>
<p>To configure a Twitter App visit <a href="https://dev.twitter.com/">https://dev.twitter.com/</a></p>
<p>&nbsp;</p>
<p>To configure a bitly account visit <a href="http://bit.ly">http://bit.ly</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Installation</strong></p>
<p>&nbsp;</p>
<p>Extract the source files to a folder on your system i.e. /home/php/magento</p>
<p>&nbsp;</p>
<p>A new folder producttweet will be created.</p>
<p>&nbsp;</p>
<p>Make sure the subfolders cache, and log are writeable by your current and crontab users.</p>
<p>&nbsp;</p>
<p><strong>Configuration</strong></p>
<p>&nbsp;</p>
<p>Edit the file applicationConfig.php in /producttweet/config.</p>
<p>&nbsp;</p>
<p>Edit</p>
<p>const PATH_TO_MAGENTO_INSTALLATION = &#8216;/home/www/dev/magento/&#8217;;</p>
<p>&nbsp;</p>
<p>With the actual path to your Magento installation.</p>
<p>&nbsp;</p>
<p>Edit</p>
<p>const FILE_CACHE_FOLDER = &#8216;/home/php/producttweet/cache/&#8217;;</p>
<p>&nbsp;</p>
<p>With the full path to the producttweet cache folder.</p>
<p>&nbsp;</p>
<p>Edit the Twitter and Bitly api authentication details.</p>
<p>&nbsp;</p>
<p>Edit the application configuration settings:</p>
<p>&nbsp;</p>
<p>tweetsPerSession &#8211; this is the number of products that will be Tweeted each time the script runs.</p>
<p>tweetHeadline &#8211; this is the prefix to the Tweet text.</p>
<p>tweetFromHour &#8211; Time range to tweet between &#8211; from hour between 00 and 23</p>
<p>tweetToHour &#8211; Time range to tweet between &#8211; to hour between 00 and 23</p>
<p>&nbsp;</p>
<p>e.g. to only tweet between 0900 and 2200 set the From hour to 09 and the To hour to 23.</p>
<p>&nbsp;</p>
<p>useDecriptionText &#8211; set this to short or long to use either the short or long product description for the tweet text.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Save the file.</p>
<p>&nbsp;</p>
<p><strong>Usage</strong></p>
<p>&nbsp;</p>
<p>To run the script for the first time to check functionality change to the scripts working directory and type</p>
<p>&nbsp;</p>
<p>php tweetproduct.php notweet</p>
<p>&nbsp;</p>
<p>The script will execute normally but with tweeting disabled. If there are errors with your main configuration you will see them reported now. If no errors are reported the script will return a summary of all products in your Magento database with a New From date that matches todays date.</p>
<p>&nbsp;</p>
<p>If no products are returned check that you have set the new from date attribute correctly on a product.</p>
<p>&nbsp;</p>
<p>If products are found a summary of each products will be shown including an example of the Tweet text and URL e.g.</p>
<p>&nbsp;</p>
[Magento Product Tweet v0.56 22.10.2012]
<p>Session started &#8211; 2012-10-22 18:12:33</p>
<p>&nbsp;</p>
[Search Results]
<p>//&#8211;&gt;</p>
<p>135 &#8211; Anashria Womens Premier Leather Sandal / ana</p>
<p>NEW TODAY! Anashria Womens Premier Leather Sandal, Buckle embellished contrasting straps adorn both the heel and&#8230; <a href="http://bit.ly/VrhMwA">http://bit.ly/VrhMwA</a> &#8211; 136</p>
<p>Cache file /root/Dropbox/paj/www/dev/magento/tweetproducts/cache/2012-10-22-9ac43d1842fd2477f500d028b158b496 created.</p>
<p>&lt;&#8211;//</p>
<p>//&#8211;&gt;</p>
<p>132 &#8211; SLR Camera Tripod / ac674</p>
<p>NEW TODAY! SLR Camera Tripod, Sturdy, lightweight tripods are designed to meet the needs of amateur and professional&#8230; <a href="http://bit.ly/VtXzX1">http://bit.ly/VtXzX1</a> &#8211; 140</p>
<p>&nbsp;</p>
<p>Session tweet limit (1) reached, ending session.</p>
<p>&nbsp;</p>
[Summary for collection type &#8211; newfromdate]
<p>2 product/s found.</p>
<p>1 product/s tweeted this session.</p>
<p>1 product/s tweeted today &#8211; 2012-10-22.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>If the results and Tweet examples are correct run the script again with the flushcache swith to delete the cache files :</p>
<p>&nbsp;</p>
<p>php tweetproducts.php flushcache</p>
<p>&nbsp;</p>
<p>And then run the script without the notweet switch to test live tweeting.</p>
<p>&nbsp;</p>
<p>A tweet success or failure message will be displayed for each product, and the tweets should appear in your twitter feed.</p>
<p>&nbsp;</p>
<p>Script activity will be logged in the ./log folder. You can delete the log files with the flushlogs switch.</p>
<p>&nbsp;</p>
<p>To automate tweeting completely add the script to your crontab, e.g. to run the script every 5 minutes use</p>
<p>&nbsp;</p>
<p>*/5 * * * * /usr/bin/php -f /home/php/magento/tweetproducts.php silent</p>
<p>&nbsp;</p>
<p>Note the silent switch disables all script output.</p>
<p>&nbsp;</p>
<p>If the script detects errors use the showtrace switch for more information and email the log file to <a href="mailto:extensions@gaiterjones.com">extensions@gaiterjones.com</a> for assistance.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>PAJ 22.10.2012</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.gaiterjones.com/automatically-tweet-new-magento-products/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Magento Automated Social Media Marketing FREE Extension &#8211; Twitter, Facebook</title>
		<link>https://blog.gaiterjones.com/magento-automated-social-media-marketing/</link>
					<comments>https://blog.gaiterjones.com/magento-automated-social-media-marketing/#comments</comments>
		
		<dc:creator><![CDATA[PAJ]]></dc:creator>
		<pubDate>Thu, 15 Sep 2011 11:33:16 +0000</pubDate>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Free Magento Extensions]]></category>
		<category><![CDATA[Marketing]]></category>
		<category><![CDATA[marketing tweets]]></category>
		<category><![CDATA[Social Media Marketing]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[free magento extension]]></category>
		<category><![CDATA[Magento]]></category>
		<guid isPermaLink="false">http://blog.gaiterjones.com/?p=548</guid>

					<description><![CDATA[This Magento module provides an automated social media marketing solution by generating Magento product marketing social media posts to Twitter and Facebook when a customer places an order. How it...<a class="more-link" href="https://blog.gaiterjones.com/magento-automated-social-media-marketing/" title="Continue reading">Continue reading</a>]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" class="hang-2-column     alignnone" title="Magento Automated Social Media Marketing FREE Extension" src="https://blog.gaiterjones.com/wp-content/uploads/2011/03/buyxgeyfree-box.jpg" alt="Magento Automated Social Media Marketing FREE Extension" width="168" height="168" /><br />
This Magento module provides an automated social media marketing solution by generating Magento product marketing social media posts to Twitter and Facebook when a customer places an order.</p>
<h1><strong>How it Works</strong></h1>
<p>The code in the module is called at checkout and a random product is selected from products in  the customers cart. The information from this random &#8220;Top Seller&#8221; product is used to create a product marketing post, including a headline, short description and short Bit.ly URL to link to the product page. The built in Magento scheduling system is then used to regularly check for new marketing posts and send them to Twitter and Facebook.</p>
<figure id="attachment_17" aria-describedby="caption-attachment-17" style="width: 528px" class="wp-caption alignnone"><img fetchpriority="high" decoding="async" class="size-full wp-image-17" title="Example automated product marketing tweet" src="https://blog.gaiterjones.com/wp-content/uploads/2010/12/Image12.jpg" alt="Example automated product marketing tweet" width="528" height="102" srcset="https://blog.gaiterjones.com/wp-content/uploads/2010/12/Image12.jpg 528w, https://blog.gaiterjones.com/wp-content/uploads/2010/12/Image12-300x57.jpg 300w" sizes="(max-width: 528px) 100vw, 528px" /><figcaption id="caption-attachment-17" class="wp-caption-text">Example automated product marketing tweet</figcaption></figure>
<p>&nbsp;</p>
<p>To use this module you must enable the Magento scheduling system and will need a Twitter  account, and configured Twitter application, a Facebook account and configured Facebook application and a Bit.ly account, further information for setting these accounts up is detailed below.</p>
<figure id="attachment_565" aria-describedby="caption-attachment-565" style="width: 425px" class="wp-caption alignnone"><img decoding="async" class="size-full wp-image-565" title="Magento Automated Social Media Marketing Facebook Example" src="https://blog.gaiterjones.com/wp-content/uploads/2011/09/social-media-marketing-twitter-6.jpg" alt="Magento Automated Social Media Marketing Facebook Example" width="425" height="136" /><figcaption id="caption-attachment-565" class="wp-caption-text">Example automated Facebook post</figcaption></figure>
<p>&nbsp;</p>
<p>Tested with Magento CE 1.6.1</p>
<p>I am looking for <strong>extension testers</strong>, <a href="https://blog.gaiterjones.com/dev/extension.php?id=2f7ab7ec9e088352b822073749d6e7d0" target="_blank">download BETA version 0.26 (last updated 09-12-2011) of the extension <strong>here</strong></a></p>
<p><strong>Updates</strong></p>
<p>If you use this extension be sure to update to the latest version.</p>
<p>*  0.22 &#8211; First beta release. 15.09.2011<br />
*  0.23 &#8211; Developed Facebook integration and duplicate post control logic. 16.09.2011<br />
* 0.24 &#8211; Improved Facebook posting, added logic to exclude posts for products in specified categories. 19.09.2011<br />
* 0.25 &#8211; Added time range to stop being too <em>spammy</em> by restricting posts to specific hours of the day. 04.11.2011<br />
* 0.26 &#8211; Fixed grouped products not being posted due to hidden child simple products of the parent group product.</p>
<p><strong>Wishlist</strong></p>
<p>Implement logic to control the duplication of product Tweets. Done &#8211; v0.23<br />
Extend to other Social Media platforms, Facebook, etc. Facebook Support in v0.23<br />
Implement hash tags for Twitter.<br />
Add to Cart link in Facebook posts<br />
Add option to use Short or Long description text.</p>
<h1><strong>Installation</strong></h1>
<p>Prerequisites :</p>
<p>Enable Magento scheduling system<br />
Twitter Account<br />
Twitter Application<br />
Facebook Account<br />
Authorised Facebook Application</p>
<p>Bit.ly Account (optional)</p>
<p>To install this extension:</p>
<p><strong>1.</strong> Unzip the module and copy the contents of the modules app folder to the app folder of your Magento store installation.</p>
<p><strong>2</strong>. Ensure that the module /cache and /cache/Bitly folders have write permissions set to allow the WWW user group write access. The module stores the product Tweets and caches the Bit.ly short URLs in this folder.</p>
<p><strong>3</strong>. Refresh the Magento Store cache</p>
<p><strong>4.</strong> Logout and login back into the admin backend, goto System &#8211; Configuration and locate the configuration settings under My Extensions &#8211; Social Media Marketing.</p>
<h1><strong>Configuration</strong></h1>
<p>1. Configure the Twitter, Facebook and Bit.ly account, authorisation and API keys. See below for further information. If you do not want to use the Bit.ly short URL service set the enable option to no.</p>
<p>Twitter is enabled by default, Facebook is disabled by default.</p>
<p>2. Define a headline prefix for the product marketing text, the default if left blank is &#8220;Top Seller:&#8221; To disable this prefix enter NONE. For Facebook you can define the text to use for the post header. Define the &#8220;uniqueness&#8221; value for posts, this value will be used to check for if a product has already been posted in the last X posts, where X is the value you define here. This will help prevent duplicate posts. You can also configure a time range so that Social Media Marketing posts will only be made during the times selected.</p>
<p>3. Configure Google UTM tags for traffic tracking in Google analytics.e.g. ?utm_source=SocialMediaMarketing&amp;utm_medium=Top-Seller&amp;utm_campaign=MyCampaig</p>
<figure id="attachment_608" aria-describedby="caption-attachment-608" style="width: 620px" class="wp-caption alignnone"><a href="https://blog.gaiterjones.com/wp-content/uploads/2011/09/SocialMediaMarketingUTMTagsMagento.jpg"><img loading="lazy" decoding="async" class="size-large wp-image-608" title="Google Analytics Magento Social Media Marketing Revenue Report" src="https://blog.gaiterjones.com/wp-content/uploads/2011/09/SocialMediaMarketingUTMTagsMagento-620x95.jpg" alt="" width="620" height="95" srcset="https://blog.gaiterjones.com/wp-content/uploads/2011/09/SocialMediaMarketingUTMTagsMagento-620x95.jpg 620w, https://blog.gaiterjones.com/wp-content/uploads/2011/09/SocialMediaMarketingUTMTagsMagento-440x67.jpg 440w, https://blog.gaiterjones.com/wp-content/uploads/2011/09/SocialMediaMarketingUTMTagsMagento.jpg 1423w" sizes="(max-width: 620px) 100vw, 620px" /></a><figcaption id="caption-attachment-608" class="wp-caption-text">Example Google Analytics Magento Social Media Marketing Revenue Report</figcaption></figure>
<p>&nbsp;</p>
<p>4. Enable email alerts which will help you debug the module during testing.</p>
<p>5. Save the extension configuration settings and test.</p>
<h1><strong>Testing</strong></h1>
<p>Make a test order in your store to test the extension. Upon checkout completion the product marketing information will be written to the modules cache folder. At the next scheduled Magento task execution the text will be posted to Twitter (and Facebook if enabled) and the cached file deleted.</p>
<p>To force the Magento scheduler to run navigate to <strong>http://www.yourwebshop.com/cron.php</strong>. Check your Twitter and Facebook pages to confirm the marketing post has been submitted. Any errors that occur during this process will be emailed to the default store email address if you set email alerts enabled to <em>YES</em> in the configuration.</p>
<figure id="attachment_556" aria-describedby="caption-attachment-556" style="width: 440px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-medium wp-image-556" title="Magento Social Media Marketing - example product tweet" src="https://blog.gaiterjones.com/wp-content/uploads/2011/09/social-media-marketing-twitter-4-440x70.jpg" alt="Magento Social Media Marketing - example product tweet" width="440" height="70" srcset="https://blog.gaiterjones.com/wp-content/uploads/2011/09/social-media-marketing-twitter-4-440x70.jpg 440w, https://blog.gaiterjones.com/wp-content/uploads/2011/09/social-media-marketing-twitter-4.jpg 533w" sizes="(max-width: 440px) 100vw, 440px" /><figcaption id="caption-attachment-556" class="wp-caption-text">example product tweet</figcaption></figure>
<h1></h1>
<h1><strong><strong><strong><strong>ENABLE MAGENTO SCHEDULING</strong></strong></strong></strong></h1>
<p>Magento uses a single file named <strong>cron.php</strong> to execute all its scheduled tasks –  cron.php should be executed regularly to allow configured background tasks in Magento to run and is also used by this module to check for marketing information to post. For example to run cron.php every 5 minutes add the following or similar to your crontab (crontab -e):</p>
<p><em>*/5 * * * * /usr/bin/php -f  /PATH-TO-MAGENTO/cron.php</em></p>
<p>Alternatively for testing you can execute cron.php from your browser by browsing to</p>
<p><em>http://www.yourstore.com/cron.php</em></p>
<p>&nbsp;</p>
<h1><strong><strong>TWITTER Configuration<br />
</strong></strong></h1>
<p>Folow the steps below to create a Twitter application that will be used by the module to access your Twitter account and post product marketing Tweets.</p>
<p>1. If you do not already have a Twitter account, create an account at <a href="http://www.tiwtter.com">http://www.tiwtter.com</a></p>
<p>2. Go to <a href="https://dev.twitter.com/">https://dev.twitter.com/</a> and login with your Twitter credentials.</p>
<p>3. Click the Create an App link.</p>
<p>4. Complete the first page of the application form with your application name, description and website address. A Callback URL is not required. Click the &#8220;Create your twitter app&#8221; button to continue.</p>
<figure id="attachment_552" aria-describedby="caption-attachment-552" style="width: 440px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-medium wp-image-552" title="Magento Social Media Marketing - configure a twitter application" src="https://blog.gaiterjones.com/wp-content/uploads/2011/09/social-media-marketing-twitter-1-440x271.jpg" alt="Magento Social Media Marketing - configure a twitter application" width="440" height="271" srcset="https://blog.gaiterjones.com/wp-content/uploads/2011/09/social-media-marketing-twitter-1-440x271.jpg 440w, https://blog.gaiterjones.com/wp-content/uploads/2011/09/social-media-marketing-twitter-1-620x382.jpg 620w, https://blog.gaiterjones.com/wp-content/uploads/2011/09/social-media-marketing-twitter-1.jpg 981w" sizes="(max-width: 440px) 100vw, 440px" /><figcaption id="caption-attachment-552" class="wp-caption-text">configure a twitter application</figcaption></figure>
<p>&nbsp;</p>
<p>5. Goto the application settings tab and ensure your application is set to <strong>Read and Write</strong> and click Update Setting to continue.</p>
<figure id="attachment_553" aria-describedby="caption-attachment-553" style="width: 440px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-medium wp-image-553" title="Magento Social Media Marketing - configure a twitter application" src="https://blog.gaiterjones.com/wp-content/uploads/2011/09/social-media-marketing-twitter-2-440x151.jpg" alt="Magento Social Media Marketing - configure a twitter application" width="440" height="151" srcset="https://blog.gaiterjones.com/wp-content/uploads/2011/09/social-media-marketing-twitter-2-440x151.jpg 440w, https://blog.gaiterjones.com/wp-content/uploads/2011/09/social-media-marketing-twitter-2-620x213.jpg 620w, https://blog.gaiterjones.com/wp-content/uploads/2011/09/social-media-marketing-twitter-2.jpg 637w" sizes="(max-width: 440px) 100vw, 440px" /><figcaption id="caption-attachment-553" class="wp-caption-text">ensure the application has read write access</figcaption></figure>
<p>&nbsp;</p>
<p>6. Click on the details tab and scroll down to the Create my access Token button, click it to create access tokens for the application. You will see the four main authentication tokens listed CONSUMER KEY, CONSUMER SECRET, ACCESS TOKEN and ACCESS TOKEN SECRET. Ensure that the access tokens have READ and WRITE access.</p>
<p>7. Copy each authentication token into the configuration settings of the module and click save.</p>
<p>If you do not want to use Bit.ly to shorten URLs in the marketing tweets you have the option of enabling t.co shortlinks in the application settings and you can disable Bit.ly in the extension settings.</p>
<p>You can confirm your application is enabled and has access to your Twitter account by going to account settings -&gt; applications in Twitter.</p>
<figure id="attachment_554" aria-describedby="caption-attachment-554" style="width: 440px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-medium wp-image-554" title="Magento Social Media Marketing - configure a twitter application" src="https://blog.gaiterjones.com/wp-content/uploads/2011/09/social-media-marketing-twitter-3-440x95.jpg" alt="Magento Social Media Marketing - configure a twitter application" width="440" height="95" srcset="https://blog.gaiterjones.com/wp-content/uploads/2011/09/social-media-marketing-twitter-3-440x95.jpg 440w, https://blog.gaiterjones.com/wp-content/uploads/2011/09/social-media-marketing-twitter-3-620x134.jpg 620w, https://blog.gaiterjones.com/wp-content/uploads/2011/09/social-media-marketing-twitter-3.jpg 633w" sizes="(max-width: 440px) 100vw, 440px" /><figcaption id="caption-attachment-554" class="wp-caption-text">confirm application is enabled</figcaption></figure>
<h1></h1>
<h1>FACEBOOK CONFIGURATION</h1>
<p>Login to Facebook and then browse to</p>
<p><a href="http://developers.facebook.com/">http://developers.facebook.com/</a></p>
<p>Create an application that will be used to post marketing information to your Facebook page, this can be a normal profile page or a Business/Fan page. When complete note the application ID and application secret.</p>
<p>The application must be authorised for your Facebook page to work.</p>
<p>To authorise the application for your page edit the following URL and paste to your browser, replaceing YOURAPIKEY and YOURPAGEID..</p>
<p>facebook.com/connect/prompt_permissions.php?api_key=YOURAPIKEY&amp;v=1.0&amp;next=http://www.facebook.com/connect/login_success.html?xxRESULTTOKENxx&amp;display=popup&amp;ext_perm=publish_stream&amp;enable_profile_selector=1&amp;profile_selector_ids=YOURPAGEID</p>
<h1></h1>
<h1>BIT.LY CONFIGURATION</h1>
<p>To create a Bit.ly account goto <a href="http://bit.ly">http://bit.ly</a> and register an account. Once registered obtain your API key by clicking on Account -&gt; Settings. Configure your bit.ly username and API key in the configuration settings of the extension and save them.Bit.ly is enabled by default in the extension, If you do not want to use bit.ly you can disable it in the configuration settings.</p>
<p>&nbsp;</p>
<p><strong><strong><br />
</strong></strong></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.gaiterjones.com/magento-automated-social-media-marketing/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title>The Marketing Power of Facebook &#038; Lady Gaga</title>
		<link>https://blog.gaiterjones.com/the-marketing-power-of-facebook-and-lady-gaga/</link>
					<comments>https://blog.gaiterjones.com/the-marketing-power-of-facebook-and-lady-gaga/#respond</comments>
		
		<dc:creator><![CDATA[PAJ]]></dc:creator>
		<pubDate>Tue, 05 Jul 2011 08:57:54 +0000</pubDate>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Lady Gaga]]></category>
		<category><![CDATA[Marketing]]></category>
		<category><![CDATA[Social Media Marketing]]></category>
		<guid isPermaLink="false">http://blog.gaiterjones.com/?p=473</guid>

					<description><![CDATA[The marketing power of Facebook is very interesting, take the Lady they call Gaga, she is the most popular female music artist on Facebook having accumulated so far almost 40...<a class="more-link" href="https://blog.gaiterjones.com/the-marketing-power-of-facebook-and-lady-gaga/" title="Continue reading">Continue reading</a>]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="hang-2-column    alignnone" title="The eCommerce Power of Lady Gaga on Facebook" src="https://blog.gaiterjones.com/wp-content/uploads/2011/07/lady-gaga-facebook.jpg" alt="The eCommerce Power of Lady Gaga on Facebook" width="282" height="148" />The marketing power of Facebook is very interesting, take the Lady they call Gaga, she is the most popular female music artist on Facebook having accumulated so far almost 40 million Facebook likes, almost 1.5 million people indicate their interest in her and her products (music) each week, and as you are reading this that number is raipdly rising.</p>
<p>Within 24 hours an update on her Facebook page will receive over 50,000 likes. This is the equivalent of handing out an advertising flyer to everyone in a packed out Wembley Stadium, each one reading it and indicating that they like what they have read, and it costs <em>absolutely nothing</em>.</p>
<p>These Facebook Like figures for a post are indicative of perhaps half a million to a million page views. In Marketing terms if Lady Gaga posts a link from her Facebook page to her own site advertising new music, products etc. the traffic generated would be astonishing and exceed anything you could pay Google for within the same time frame.</p>
<figure id="attachment_475" aria-describedby="caption-attachment-475" style="width: 359px" class="wp-caption alignnone"><a href="https://blog.gaiterjones.com/wp-content/uploads/2011/07/facebook-page-leaderboard1.jpg"><img loading="lazy" decoding="async" class="nohang         " title="Facebook page leaderboard 05.07.2011" src="https://blog.gaiterjones.com/wp-content/uploads/2011/07/facebook-page-leaderboard1.jpg" alt="Facebook page leaderboard 05.07.2011" width="359" height="193" /></a><figcaption id="caption-attachment-475" class="wp-caption-text">Facebook page leaderboard 05.07.2011</figcaption></figure>
<p>&nbsp;</p>
<p>Combine this with a Twitter update, she has 11 million Twitter followers, and the eCommerce power of social media networks in terms of marketing and potential exposure of new products is awesome.</p>
<p>Via Facebook and Twitter Lady Gaga has the power to instantly reach literally hundreds of thousands of customers (fans) within seconds creating the possibility to generate a <em>lot</em> of product awareness, exposure and most importantly revenue.</p>
<p>I would not like to estimate how much advertising power like this would cost to purchase. Celebrities like Lady Gaga, Eminem and Rhianna have created, quite unintentionally, the most powerful advertising vehicle on the Internet. Of course Facebook rides along on this success with its own advertising streams which also gives you an idea of how lucrative Facebook advertising can be.</p>
<p>Perhaps Lady Gaga, Rhianna and Eminem should sell update space on their Facebook sites? Now if you could promote your own products directly on Lady Gagas Facebook page, that would be pretty neat. I won&#8217;t buy her CD but I would pay for that!</p>
<p>&nbsp;</p>
<figure style="width: 640px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="hang-2-column          " title="Advertise to 90,000 people in seconds" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/79/Wembley_Stadium%2C_London.jpg/800px-Wembley_Stadium%2C_London.jpg" alt="" width="640" height="213" /><figcaption class="wp-caption-text">Advertise to 90,000 people in seconds</figcaption></figure>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.gaiterjones.com/the-marketing-power-of-facebook-and-lady-gaga/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Google Plus One button for Magento Products</title>
		<link>https://blog.gaiterjones.com/google-plus-one-button-for-magento-products/</link>
					<comments>https://blog.gaiterjones.com/google-plus-one-button-for-magento-products/#comments</comments>
		
		<dc:creator><![CDATA[PAJ]]></dc:creator>
		<pubDate>Fri, 01 Jul 2011 10:18:30 +0000</pubDate>
				<category><![CDATA[5 Minute Fix]]></category>
		<category><![CDATA[Google Plus One Button]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[Social Media Marketing]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[google plus one button]]></category>
		<category><![CDATA[plus one]]></category>
		<guid isPermaLink="false">http://blog.gaiterjones.com/?p=448</guid>

					<description><![CDATA[Google launched their Plus (+) range of products this week, Google + integrates existing products from Google along with some new social products into a new &#8220;social networking&#8221; service. Obviously...<a class="more-link" href="https://blog.gaiterjones.com/google-plus-one-button-for-magento-products/" title="Continue reading">Continue reading</a>]]></description>
										<content:encoded><![CDATA[<p><a href="https://blog.gaiterjones.com/wp-content/uploads/2011/07/Use-the-Google-Plus-one-1-button-on.jpg"><img loading="lazy" decoding="async" class="hang-1-column    alignnone" title="Google Plus one Button for Magento" src="https://blog.gaiterjones.com/wp-content/uploads/2011/07/Use-the-Google-Plus-one-1-button-on.jpg" alt="Google Plus one Button for Magento" width="240" height="218" /></a></p>
<p>Google launched their Plus (+) range of products this week, Google + integrates existing products from Google along with some new social products into a new &#8220;social networking&#8221; service. Obviously Google want to challenge Facebook as a new social networking hub. While Facebook already have a huge user base, it is nothing compared with the number of users interacting with Google on a daily basis.</p>
<p>Interestingly, as Facebook attempts to assimilate the Internet into its own social networking open graph database populated with millions of people, Google , who already have the Internet indexed and cached in its huge databases now want to pull in the millions of people to create a social networking environment built around existing, new products and of course their number one business their search engine.</p>
<p>Enter the Plus One Button</p>
<p>The Google plus one button is to Google searches what the Facebook like button is to web content. Google <a href="http://www.google.com/+1/button/" target="_blank">says </a>&#8220;The +1 button is shorthand for &#8220;this is pretty cool&#8221; or &#8220;you should check this out.&#8221;&#8221;. When you or someone in your Google social circle &#8220;plus one&#8221; something by clicking the plus one button on a site, this information will be used by Google to manipulate/improve Google search results so that when you search for something you will be able to see for example if your friends have already recommended the product returned in the search. If your best buddy likes it, it must be good right? Whether its &#8220;pretty cool&#8221; or not lets wait and see, no doubt Google Plus will be THE next big thing. The plus one button is a clever way for Google to rewarding good web content and personalise search results, as (in theory) only humans will be able to &#8220;Plus One&#8221; something.</p>
<p>I am still getting my head around Google plus one and all of its implications but needless to say if there is a new social media marketing opportunity out there, especially one so tightly integrated with Google search then we need to take advantage of it and enable plus one buttons for our Magento products. Content with a large amount of +1s will get higher rankings in Google’s organic search results, create more visibility for your products and drive more traffic to your site. Google says &#8220;Think of the +1 button as a way for fans of your business to recommend what you offer, for all their friends and contacts to see. By helping searchers see more personal, relevant ads, we believe you’ll see more qualified traffic.&#8221;</p>
<p align="center"><img decoding="async" src="http://services.google.com/fh/files/newsletters/04_annotation.png" alt="" /></p>
<p>Here is a 5 minute fix to add the plus one button to all Magento product pages.</p>
<h2>Adding Plus One</h2>
<p>For Magento 1.4+ stores:</p>
<p>We can place the Google plus one button next to our <a title="Magento Product Social Media Marketing Part 1 – the Facebook Like Button" href="https://blog.gaiterjones.com/magento-social-media-marketing-facebook-like-button/" target="_blank">Facebook Like button</a> with a few lines of code. Locate <em>view.phtml</em> in your theme, it will be located in the <em>default/template/catalog/product </em>folder of your theme.</p>
<pre class="brush:php">&lt;!-- Google Plus One Button BEGIN --&gt;
&lt;div id="google-plusone"&gt;
&lt;script type="text/javascript" src="https://apis.google.com/js/plusone.js"&gt;
{"parsetags": "explicit"},
{"lang": "&lt;?php echo $this-&gt;__('en-GB') ?&gt;"}
&lt;/script&gt;
&lt;g:plusone size="medium" count="false" href="&lt;?php echo trim(Mage::registry('current_product')-&gt;getProductUrl()) ?&gt;"&lt;/g:plusone&gt;
&lt;/div&gt;
&lt;script type="text/javascript"&gt;
gapi.plusone.go("google-plusone");
&lt;/script&gt;
&lt;!-- Google Plus One Button END --&gt;</pre>
<p>If you already have implemented a Facebook Like button, insert the following code below the existing code You can also position the google-plusone DIV wherever you would like the button to appear on the page with CSS.</p>
<p>To translate the locale code correctly add a line to your themes locale file and refresh your cache. For example for a German language store use</p>
<p><strong>&#8220;en-GB&#8221;,&#8221;de&#8221;</strong></p>
<figure id="attachment_450" aria-describedby="caption-attachment-450" style="width: 495px" class="wp-caption alignnone"><a href="https://blog.gaiterjones.com/wp-content/uploads/2011/07/googleplusonebutton.jpg"><img loading="lazy" decoding="async" class="hang-1-column        " title="Google Plus One Button for Magento" src="https://blog.gaiterjones.com/wp-content/uploads/2011/07/googleplusonebutton.jpg" alt="Google Plus One Button for Magento" width="495" height="293" /></a><figcaption id="caption-attachment-450" class="wp-caption-text">Google Plus One Button for Magento</figcaption></figure>
<p>For Magento 1.4+ make sure you have canonical URLs enabled in admin (see my Facebook Like button <a title="Magento Product Social Media Marketing Part 1 – the Facebook Like Button" href="https://blog.gaiterjones.com/magento-social-media-marketing-facebook-like-button/" target="_blank">post</a> for more info), we have specifed the URL in the Google API code to ensure Google uses the Magento enabled canonical URL. They say that the code will default to look for the canonical tag but better to be safe than sorry &#8211; in my tests it was not always used. The size and appearance of the button can be modified by changing the <em>size </em>and <em>count </em>options. See the Google <a href="http://code.google.com/apis/+1button/" target="_blank">documentation </a>for more details.</p>
<h2>Further Reading</h2>
<p><a href="http://en.wikipedia.org/wiki/Google%2B">http://en.wikipedia.org/wiki/Google%2B</a></p>
<p><a href="http://googleblog.blogspot.com/2011/06/introducing-google-project-real-life.html">http://googleblog.blogspot.com/2011/06/introducing-google-project-real-life.html</a></p>
<p><a href="http://www.ibtimes.com/articles/172678/20110701/google-plus-facebook-killer-google-zynga-android-developers-facebook-losing-users-google-plus-next-b.htm">http://www.ibtimes.com/articles/172678/20110701/google-plus-facebook-killer-google-zynga-android-developers-facebook-losing-users-google-plus-next-b.htm</a></p>
<p><a href="http://www.aaronpeters.nl/blog/google-plus1-button-performance-review">http://www.aaronpeters.nl/blog/google-plus1-button-performance-review</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.gaiterjones.com/google-plus-one-button-for-magento-products/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Magento Product Social Media Marketing Part 2 &#8211; the AddThis Toolbar</title>
		<link>https://blog.gaiterjones.com/magento-product-social-media-marketing-addthis-toolbar/</link>
					<comments>https://blog.gaiterjones.com/magento-product-social-media-marketing-addthis-toolbar/#comments</comments>
		
		<dc:creator><![CDATA[PAJ]]></dc:creator>
		<pubDate>Wed, 02 Mar 2011 07:41:29 +0000</pubDate>
				<category><![CDATA[AddThis]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[Social Media Marketing]]></category>
		<category><![CDATA[Social Networks]]></category>
		<guid isPermaLink="false">http://blog.gaiterjones.com/?p=164</guid>

					<description><![CDATA[The AddThis Toolbar is a Social Media Marketing tool that &#8220;helps website publishers and bloggers spread their content across the web by making it easy for visitors to bookmark and...<a class="more-link" href="https://blog.gaiterjones.com/magento-product-social-media-marketing-addthis-toolbar/" title="Continue reading">Continue reading</a>]]></description>
										<content:encoded><![CDATA[<p>The AddThis Toolbar is a Social Media Marketing tool that &#8220;helps website publishers and bloggers spread their content across the web by making it easy for visitors to bookmark and share content to their favorite social destinations. AddThis offers sophisticated analytics to help users understand how and where their content is being shared.&#8221;</p>
<p>Add This is a useful addition to our Magento product Social Media Marketing tools which already include <a href="https://blog.gaiterjones.com/automatic-magento-product-marketing-tweets-for-twitter/">Twitter product marketing tweets</a> and the <a href="https://blog.gaiterjones.com/magento-social-media-marketing-facebook-like-button/">Facebook Like Button</a> and will add another 300 or more Social Networking services available for content sharing and marketing.</p>
<p>Add This functionality is easy to integrate into the product pages of a Magento 1.3.x, 1.4.x or 1.5.x eCommerce store. First you need to sign up for an AddThis account, creating an account will give you access to detailed analytic reports so you can see how your customers are sharing your product information across various Social Networking platforms and destination. Sign up for an account here:</p>
<p><a href="http://www.addthis.com/register" target="_blank">http://www.addthis.com/register</a></p>
<p>Connect to your Magento site and navigate to the <em>template/page/html</em> folder in your Magento theme and open <em>head.phtml</em> for editing.</p>
<p>For <strong>Magento 1.3.x</strong> with the <em>Yoast canonical URL</em> extension installed paste the following code at the end of the file. See <a title="Magento Product Social Media Marketing Part 1 – the Facebook Like Button" href="https://blog.gaiterjones.com/magento-social-media-marketing-facebook-like-button/">this post</a> for more details on installing the Yoast extension.</p>
<pre class="brush:php">&lt;?php if (Mage::registry('current_product')) : ?&gt;
&lt;script type="text/javascript" src="https://s7.addthis.com/js/250/addthis_widget.js#username=YOUR-ADDTHIS-USERNAME"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
function addThis(){
        return '&lt;div id="addthis_product_toolbar" class="addthis_toolbox addthis_default_style " addthis:url="&lt;?php echo str_replace($this-&gt;getBaseUrl(),"http://YOUR-DOMAIN-NAME/",$this-&gt;_data['urlKey']) ?&gt;" addthis:title="&lt;?php echo trim(Mage::registry('current_product')-&gt;getName())?&gt;" addthis:description="&lt;?php echo strip_tags(str_replace("&lt;br /&gt;",", ",substr(Mage::registry('current_product')-&gt;getDescription(), 0, strpos(Mage::registry('current_product')-&gt;getDescription(), '.')+1))) ?&gt;"&gt;';
    }

var addthis_config = {
        services_exclude: 'facebook',
		data_ga_property: 'YOUR-GOOGLE-ANALYTICS-UA-ID',
		data_track_clickback: true

}
&lt;/script&gt;
&lt;?php endif; ?&gt;</pre>
<p>For <strong>Magento 1.4.x</strong> and <strong>1.5.x</strong> with canonical URLs enabled paste the following code at the end of the file.</p>
<pre class="brush:php">&lt;?php if (Mage::registry('current_product')) : ?&gt;
&lt;script type="text/javascript" src="https://s7.addthis.com/js/250/addthis_widget.js#username=YOUR-ADDTHIS-USERNAME"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
function addThis(){
        return '&lt;div id="addthis_product_toolbar" class="addthis_toolbox addthis_default_style " addthis:url="&lt;?php echo str_replace($this-&gt;getBaseUrl(),"http://YOUR-DOMAIN-NAME/",trim(Mage::registry('current_product')-&gt;getProductUrl())) ?&gt;" addthis:title="&lt;?php echo trim(Mage::registry('current_product')-&gt;getName())?&gt;" addthis:description="&lt;?php echo strip_tags(str_replace("&lt;br /&gt;",", ",substr(Mage::registry('current_product')-&gt;getDescription(), 0, strpos(Mage::registry('current_product')-&gt;getDescription(), '.')+1))) ?&gt;"&gt;';
    }

var addthis_config = {
        services_exclude: 'facebook',
		data_ga_property: 'YOUR-GOOGLE-ANALYTICS-UA-ID',
		data_track_clickback: true

}
&lt;/script&gt;
&lt;?php endif; ?&gt;</pre>
<p>The code checks first that the page is a product page and then links to the AddThis Javascript code and creates a funtion containing our AddThis HTML elements and configuration data. Add your AddThis username, your domain name and your Google Anayltics ID (if you have one) and save the file. Note that I&#8217;m assuming you already have a Facebook Like button so we tell AddThis to exclude Facebook from the list of Social Networking sites available so that its not displayed twice on your product page.</p>
<p>To add the AddThis toolbar to our product pages we need to locate view.phtml in the /template/catalog/product folder of our theme. Open view.phtml and look for the element or div that renders the product-name, around about line 50. If you have implemented my Facebook Like Button solution, the Like Button code will be here, the AddThis toolbar can sit nicely underneath the Like Button. You can also move the code or style the toolbar to appear wherever you like on your product page.</p>
<p>Paste the following code in to <em>view.phtml </em>and save the file.</p>
<pre class="brush:xml">&lt;!-- AddThis Product Toolbar BEGIN --&gt;
&lt;script type="text/javascript"&gt;
document.write(addThis());
&lt;/script&gt;
&lt;a class="addthis_button_preferred_1"&gt;&lt;/a&gt;
&lt;a class="addthis_button_preferred_2"&gt;&lt;/a&gt;
&lt;a class="addthis_button_preferred_3"&gt;&lt;/a&gt;
&lt;a class="addthis_button_preferred_4"&gt;&lt;/a&gt;
&lt;a class="addthis_button_compact"&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;!-- AddThis Product Toolbar END --&gt;</pre>
<p>Refresh a product page to see the new AddThis toolbar.</p>
<figure id="attachment_168" aria-describedby="caption-attachment-168" style="width: 522px" class="wp-caption alignnone"><a href="https://blog.gaiterjones.com/wp-content/uploads/2011/02/Image5.jpg"><img loading="lazy" decoding="async" class="hang-1-column     " style="border: 1px solid gray;" title="AddThis Toolbar integrated into Magento 1.5.1 Demo Store" src="https://blog.gaiterjones.com/wp-content/uploads/2011/02/Image5.jpg" alt="AddThis Toolbar integrated into Magento 1.5.1 Demo Store" width="522" height="281" /></a><figcaption id="caption-attachment-168" class="wp-caption-text">AddThis Toolbar integrated into Magento 1.5.1 Demo Store</figcaption></figure>
<p>If it looks a bit cramped under the Like Button add a CSS style to your themes stylesheet to move the toolbar down a little.</p>
<pre class="brush:css">/*Add This tool bar*/
#addthis_product_toolbar {
padding-top: 5px;
}</pre>
<p>The AddThis service dynamically creates the list of available Social Network services based on the information gleaned from the user, browser language etc. If you like you can override the services on the Toolbar, see the Add This site for further details. Test the services to your product details are being sent to AddThis correctly.</p>
<p>There are a variety of toolbars available:</p>
<figure id="attachment_169" aria-describedby="caption-attachment-169" style="width: 220px" class="wp-caption alignnone"><a href="https://blog.gaiterjones.com/wp-content/uploads/2011/02/Image6.jpg"><img loading="lazy" decoding="async" style="border: 1px solid black;" title="Range of AddThis toolbar styles available" src="https://blog.gaiterjones.com/wp-content/uploads/2011/02/Image6.jpg" alt="Range of AddThis toolbar styles available" width="220" height="290" /></a><figcaption id="caption-attachment-169" class="wp-caption-text">Range of AddThis toolbar styles available</figcaption></figure>
<p>You can find the code to change how the toolbar looks here <a href="http://www.addthis.com/web-button-select">http://www.addthis.com/web-button-select</a>.</p>
<p>There are also various configuration options availabe for AddThis, for example if you want to specifiy language for a specific store or the bit.ly account to use for short URLs use the following code to extend the Javascript addThis configuration variables.</p>
<pre class="brush:xml">		&lt;?php if (Mage::app()-&gt;getStore()-&gt;getId()==1): ?&gt;
		ui_language: 'de',
		&lt;?php endif ?&gt;
		url_transforms : {
			shorten: {
				twitter: 'bitly'
			}
		},
		shorteners : {
			bitly : {
			login: 'YOUR-BITLY-USERNAME',
			apiKey: 'YOUR-BITLY-API-KEY'
			}
		}</pre>
<p>After a few days login to AddThis and check out your Analytics statistics to see how your customers have been sharing your products across various Social Media destinations.</p>
<figure id="attachment_271" aria-describedby="caption-attachment-271" style="width: 620px" class="wp-caption alignnone"><a href="https://blog.gaiterjones.com/wp-content/uploads/2011/03/addthis-analytics.jpg"><img loading="lazy" decoding="async" class="hang-2-column    " style="border: 1px solid black;" title="AddThis Analytics" src="https://blog.gaiterjones.com/wp-content/uploads/2011/03/addthis-analytics-620x220.jpg" alt="AddThis Analytics" width="620" height="220" /></a><figcaption id="caption-attachment-271" class="wp-caption-text">AddThis Analytics</figcaption></figure>
<p><a href="http://www.addthis.com/analytics" target="_blank">http://www.addthis.com/analytics</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.gaiterjones.com/magento-product-social-media-marketing-addthis-toolbar/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Automatic Magento Product Marketing Tweets for Twitter</title>
		<link>https://blog.gaiterjones.com/automatic-magento-product-marketing-tweets-for-twitter/</link>
					<comments>https://blog.gaiterjones.com/automatic-magento-product-marketing-tweets-for-twitter/#comments</comments>
		
		<dc:creator><![CDATA[PAJ]]></dc:creator>
		<pubDate>Tue, 28 Dec 2010 16:04:31 +0000</pubDate>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Social Media Marketing]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Marketing Tweets]]></category>
		<guid isPermaLink="false">http://blog.gaiterjones.com/?p=5</guid>

					<description><![CDATA[THIS MAGENTO HACK IS NOW A MAGENTO MODULE/EXTENSION, CLICK HERE FOR MORE INFO Wouldn&#8217;t it be great if your customers could do your twitter product marketing for you? Thats what...<a class="more-link" href="https://blog.gaiterjones.com/automatic-magento-product-marketing-tweets-for-twitter/" title="Continue reading">Continue reading</a>]]></description>
										<content:encoded><![CDATA[<p><a title="Magento Automated Social Media Marketing FREE Extension – Twitter, Facebook" href="https://blog.gaiterjones.com/magento-automated-social-media-marketing/"><strong>THIS MAGENTO HACK IS NOW A MAGENTO MODULE/EXTENSION, CLICK HERE FOR MORE INFO</strong></a></p>
<p>Wouldn&#8217;t it be great if your customers could do your twitter product marketing for you? Thats what I thought after seeing a few automated marketing posts coming up in my twitter feed. So I set about looking at my own automated marketing tweets triggered when a customer placed an order in our Magento e-commerce store. The goal was to randomly select a product from the last order &#8211; a so called &#8220;Top Seller&#8221;, wrap it up nicely in a 140 char tweet with a URL to the product page and post it to twitter automatically from the onepage checkout success page as the customer completed checkout. After a day or so of development I came up with a solution that looks something like this on Magento 1.3.3.0 using the test database.</p>
<figure id="attachment_17" aria-describedby="caption-attachment-17" style="width: 528px" class="wp-caption alignnone"><a href="https://blog.gaiterjones.com/wp-content/uploads/2010/12/Image12.jpg"><img loading="lazy" decoding="async" class="hang-1-column  " style="border: 1px solid black;" title="Example automated product marketing tweet" src="https://blog.gaiterjones.com/wp-content/uploads/2010/12/Image12.jpg" alt="Example automated product marketing tweet" width="528" height="102" /></a><figcaption id="caption-attachment-17" class="wp-caption-text">Example automated product marketing tweet</figcaption></figure>
<h2>Step 1 &#8211; Installing in Magento</h2>
<p>To integrate the code into Magento you can either use the onepage checkout success.phtml file to call the code after checkout, or if you have already developed your own Magento code modules you can create a new template phtml file and test the code by calling  it from a CMS block in Magento  i.e.</p>
<pre class="brush:xml">&lt;div&gt;{{block type="MY_Page/view" template="Page/tweet.phtml"}}&lt;/div&gt;</pre>
<p>If you use success.phtml you will need to submit an order from your webshop to test the code, if you are using CMS simply browse to the CMS page you created, i.e. <em>http://www.mysite.com/tweet</em></p>
<p>Here is the working code to use either in your own phtml template file or to append to success.phtml in your frontend themes template files.</p>
<pre class="brush:php">&lt;?php
// Magento Product Twitter Marketing
//
// paj
// www.gaiterjones.com
// tested with Magento 1.3.3.0
// v1.0

// Short URL function
function make_bitly_url($url,$login,$appkey,$format = 'xml',$history = 1)
{
//create the URL
	$bitly = 'http://api.bit.ly/v3/shorten?login='.$login.'&amp;apiKey='.$appkey.'&amp;uri='.urlencode($url). '&amp;format='.$format.'&amp;history='.$history;

//get the url
$response = file_get_contents($bitly);

//parse depending on desired format

	if(strtolower($format) == 'json')
		{
			$json = @json_decode($response,true);
			return $json['data']['url'];
		}
	elseif(strtolower($format) == 'xml') //xml
		{

			$xml = simplexml_load_string($response);
			return $xml-&gt;data-&gt;url;
		}
	elseif(strtolower($format) == 'txt') //text
		{
			return $response;
		}
}

// Get last order from Magento session.
$orderId = Mage::getModel('sales/order')-&gt;load(Mage::getSingleton('checkout/session')-&gt;getLastOrderId());
$order = Mage::getModel('sales/order')-&gt;load($orderId);
$items = $order-&gt;getAllItems();
$itemcount=count($items);
//$name=array();
//$unitPrice=array();
//$sku=array();
$ids=array();
//$qty=array();

try
{

// Build arrays, uncomment as needed to populate arrays with more order information, SKU, price etc.
foreach ($items as $itemId =&gt; $item)
{
	// $name[] = $item-&gt;getName();
	// $unitPrice[]=$item-&gt;getPrice();
	// $sku[]=$item-&gt;getSku();
	// we are only interested in the product id
	$ids[]=$item-&gt;getProductId();
	// $qty[]=$item-&gt;getQtyToInvoice();

//	echo $name[$itemId]. ' - ' .$sku[$itemId]. ' - €'. $unitPrice[$itemId]. '&lt;br&gt;';
}

	do {

	shuffle ($ids);
	$rand_keys = (count($ids) &gt; 1)?array_rand($ids, $itemcount):array_keys($ids);
	$custom = Mage::getModel('catalog/product')-&gt;load($ids[$rand_keys[0]]);

	// Make sure the product is visible in catalog
	if ($custom-&gt;getVisibility()==4) {

	// twitter text prefix, this will appear before your product description
	$twitter_txt=$this-&gt;__('Top Seller'). ": ";

	// twitter txt URL - add a short URL to the product using bit.ly API
	$shorturl=make_bitly_url($custom-&gt;getProductUrl(),'YOUR-BITLY-USERNAME','YOUR-BITLY-API');

	// The text between our tweet and the shorturl when the tweet is longer than 140 chars
	$twitter_txt_suffix = '... ';
	$chars_remaining=140-(strlen($shorturl)+strlen($twitter_txt_suffix));

	// debugging echos comment these out when testing complete.
	// Check lengths of short url, prefix etc.
	echo $shorturl. ' is '. strlen($shorturl). ' chars.&lt;br&gt;';
	echo 'Suffix and URL are '. (strlen($shorturl)+strlen($twitter_txt_suffix)). ' chars.&lt;br&gt;';
	echo 'Characters remaining for tweet : '. $chars_remaining. '&lt;br&gt;';

	// Prepare tweet text
	$twitter_txt=$twitter_txt . strip_tags(str_replace("&lt;br /&gt;",", ",substr($custom-&gt;getDescription(), 0, strpos($custom-&gt;getDescription(), '.')+1))). ' ';

	// Make sure we only tweet 140 chars or less

		if (strlen($twitter_txt) &lt;= $chars_remaining) {
			$twitter_txt = $twitter_txt; //do nothing
		}
		else {
			$twitter_txt = wordwrap($twitter_txt, $chars_remaining);
			$twitter_txt = substr($twitter_txt, 0, strpos($twitter_txt, "\n"));
			$twitter_txt = $twitter_txt. $twitter_txt_suffix;
		}

	// Complete tweet text with short url.
	$twitter_txt = $twitter_txt. ' ' .$shorturl;

	// Get ready to tweet
	$accessToken = file_get_contents("/home/www/classes/twitteroauth/access_token");
	$accessTokenSecret = file_get_contents("/home/www/classes/twitteroauth/access_token_secret");

	// Create our twitter API object
	require_once('/home/www/classes/twitteroauth/twitteroauth.php');
	$oauth = new TwitterOAuth('YOUR-TWITTER-CONSUMER-KEY', 'YOUR-TWITTER-CONSUMER-SECRET', $accessToken, $accessTokenSecret);

	// Send an API request to verify credentials
	$credentials = $oauth-&gt;get("account/verify_credentials");
	echo "Connected as @" . $credentials-&gt;screen_name. '&lt;br&gt;';

	// TWEEET, uncomment to tweet.
	//$oauth-&gt;post('statuses/update', array('status' =&gt; $twitter_txt));

	// debugging echos comment these out when testing complete.
	echo 'Simulated tweet : ('. strlen($twitter_txt). ' chars long.)&lt;br&gt;&lt;br&gt;';
	echo '&lt;strong&gt;'. $twitter_txt. '&lt;/strong&gt;&lt;br&gt;';

	}

	} while ($custom-&gt;getVisibility()!=4);

// debugging use this to catch any errors, remove error message when testing complete.
} catch (Exception $ex) { echo "An Error was detected."; }		

?&gt;</pre>
<p>Copy and paste the code at the end of your one page checkout success.phtml file or paste it into a new template phtml file i.e. tweet.phtml.</p>
<p>The first function is used to create a shortened URL via the bit.ly API, for this you will need a bit.ly account and your bit.ly API key (available form the settings menu in your account). We are only really interested in the product ids from the order, but if you want to use other information in your tweet remove the comments from the array loop.</p>
<p>$twitter_txt contains our tweet text. It starts out with a prefix &#8220;Top Sellers&#8221; and then uses an excerpt from the Magento product description to create the rest of the tweet text.</p>
<pre class="brush:php">$twitter_txt=$twitter_txt . strip_tags(str_replace("&lt;br /&gt;",", ",substr($custom-&gt;getDescription(),0, strpos($custom-&gt;getDescription(), '.')+1))). ' ';</pre>
<p>My product descriptions text always includes the product name on the first line of the long description text followed by a line break e.g.</p>
<pre class="brush:groovy">&lt;p&gt;&lt;strong&gt;Nokia 2610 Phone&lt;/strong&gt;&lt;br /&gt;The Nokia 2610 is an easy to use device that combines multiple messaging options including email, instant messaging, and more.</pre>
<p>We strip out the HTML replacing the first html line break with a comma and then search for the next full stop to extract the first sentence from our description. (This is also a good technique I have used  for<a href="https://blog.gaiterjones.com/magento-seo-generate-meta-description-tags-automatically/"> automatic SEO meta description tags for products</a>.)  If your product descriptions do not include line breaks you will need to play with this code so that it extracts a product description that suits your requirements.</p>
<p>We need to make sure our tweet including prefix and short url are less than 140 chars so we use some code to check how long the tweet product description text is and shorten it if required adding a &#8220;&#8230;&#8221; suffix. Now we have our tweet text and call the Twitter oAuth code to authenticate and post the tweet. The code that makes the tweet is commented, and for testing the tweet text will be echoed out so you can easily debug your tweet and description text, the simulated tweet should look something like this:</p>
<pre>http://bit.ly/hd6Et1 is 20 chars.
Suffix and URL are 24 chars.
Characters remaining for tweet : 116
Connected as @your-twitter-username
Simulated tweet : (135 chars long.)
<strong>Top Seller: Nokia 2610 Phone, The Nokia 2610 is an easy to use device </strong><strong>that combines multiple messaging options... http://bit.ly/hC6Et1</strong></pre>
<figure id="attachment_25" aria-describedby="caption-attachment-25" style="width: 519px" class="wp-caption alignnone"><a href="https://blog.gaiterjones.com/wp-content/uploads/2010/12/Image5.jpg"><img loading="lazy" decoding="async" class="hang-1-column     " style="border: 1px solid black;" title="Debugging the tweet text from a CMS page" src="https://blog.gaiterjones.com/wp-content/uploads/2010/12/Image5.jpg" alt="Debugging the tweet text from a CMS page" width="519" height="266" /></a><figcaption id="caption-attachment-25" class="wp-caption-text">Debugging the tweet text from a CMS page</figcaption></figure>
<p>See below for setting up your twitter application and installing the oAuth code.</p>
<p>Note that you need to have an order in the current magento session, I haven&#8217;t yet figured out how to access the last order outwith the user session, so if you don&#8217;t see anything or see the exception error echoed out make sure you are logged into your magento shop and have placed a test order.</p>
<h2>Step 2 &#8211; Twitter PHP oAuth Code</h2>
<p>The Twitter oAuth authentication process is complex and way beyond my programming skills, however <a href="http://abrah.am/">Abraham Williams</a> has developed the PHP code to perform the twitter oAuth authentication and posting for us. Download the code <a href="https://github.com/abraham/twitteroauth/zipball/0.2.0-beta3">here</a>. Open the ZIP folder and extract the twitteroauth folder to a suitable area on your development host. For example /home/www/classes. The folder contains two PHP files, twitteroauth.php and OAuth.php that are called from our code, update the script include so that the path to your oAuth files is correct.</p>
<h2><strong>Step 3 &#8211; Twitter Application and Access Codes</strong></h2>
<p>Obviously to create a twitter app you need a twitter account. Login to your twitter account and go to <a href="http://dev.twitter.com/apps/new" target="_blank">http://dev.twitter.com/apps/new</a> to register a new twitter app.  Complete the registration by choosing an application name, note this name will appear under your posts! Set the application type to client and make sure you set the application type to read &amp; write.</p>
<p>When you have registered your application take a note of the <strong>Consumer Key</strong> and <strong>Consumer Secret</strong>. Click on the My Access Token right hand menu link and take a note of your <strong>Access Token (oauth_token)</strong> and <strong>Access Token Secret (oauth_token_secret)</strong>.</p>
<p>Copy and paste your Twitter Consumer Key and Consumer Secret into the script.</p>
<pre class="brush:php">$oauth = new TwitterOAuth('YOUR-TWITTER-CONSUMER-KEY','YOUR-TWITTER-CONSUMER-SECRET', $accessToken, $accessTokenSecret);</pre>
<p>The Twitter Access Token and Access Token Secret can be included in plain text in the script but for security I am separating them out into two seperate files located with my oauth PHP scripts:</p>
<pre class="brush:php">$accessToken = file_get_contents("/home/www/classes/twitteroauth/access_token");
$accessTokenSecret = file_get_contents("/home/www/classes/twitteroauth/access_token_secret");</pre>
<p>So either modify the strings above to contain your access codes as plain txt i.e. $accessToken=&#8221;MY-ACCESS-TOKEN&#8221;;  or create your own folder and paths to two files containing your twitter access keys in plain text.</p>
<h2>Step 4 &#8211; Test</h2>
<p>If you have copied the code to your success.phtml file make an order and you should see the simulated tweet with your product description on your one page checkout success page.</p>
<pre>http://bit.ly/hd6Et1 is 20 chars.
Suffix and URL are 24 chars.
Characters remaining for tweet : 116
Connected as @your-twitter-username
Simulated tweet : (135 chars long.)
<strong>Top Seller: Nokia 2610 Phone, The Nokia 2610 is an easy to use device </strong><strong>that combines multiple messaging options... http://bit.ly/hC6Et1</strong></pre>
<p>To make a test tweet uncomment the tweet statement and place another order, check your twitter account for a new tweet!</p>
<p>When you are happy with your tweet text, uncomment the debugging echos from the script and test again.</p>
<figure id="attachment_17" aria-describedby="caption-attachment-17" style="width: 528px" class="wp-caption alignnone"><a href="https://blog.gaiterjones.com/wp-content/uploads/2010/12/Image12.jpg"><img loading="lazy" decoding="async" class="hang-1-column   " style="border: 1px solid black;" title="Example automated product marketing tweet" src="https://blog.gaiterjones.com/wp-content/uploads/2010/12/Image12.jpg" alt="Example automated product marketing tweet" width="528" height="102" /></a><figcaption id="caption-attachment-17" class="wp-caption-text">Example automated product marketing tweet</figcaption></figure>
<h2><strong>Conclusions and further ideas</strong></h2>
<p>Twitter marketing can easily become Twitter spam, depending on how many orders a day your shop is getting you may need to throttle back the number of product tweets you make, the tweet could also be handled elsewhere in the app, or from a cron job that picks a random product each day. I like the idea of the &#8220;Top Seller&#8221; from an actual order, and that the customer was actually doing the marketing work for you! You may also want to extract your parent categories to create additional hash tags for your tweets to improve search results, although this will eat up your precious 140 chars.</p>
<p>Some Googled resources used in creating this solution:</p>
<p><a href="http://articles.sitepoint.com/article/oauth-for-php-twitter-apps-part-1">http://articles.sitepoint.com/article/oauth-for-php-twitter-apps-part-1</a><br />
<a href="http://subesh.com.np/2010/03/ordered-items-detail-order-id-magento/">http://subesh.com.np/2010/03/ordered-items-detail-order-id-magento/</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.gaiterjones.com/automatic-magento-product-marketing-tweets-for-twitter/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
	</channel>
</rss>
