** THIS REPO HAS BEEN ARCHIVED AND IS NO LONGER BEING ACTIVELY MAINTAINED **
FacebookAdsForSpree makes it easy to advertise your products on Facebook. It exports your Spree products to Facebook Product Catalogs and installs Facebook Pixel in your Spree shop.
- Add this extension to your Gemfile with this line:
gem 'facebook-ads', github: '[your-github-handle]/facebook-ads'
gem 'facebook_ads_for_spree', github: '[your-github-handle]/facebook_ads_for_spree'
- Install the gem using Bundler:
bundle install
- Copy & run migrations
bundle exec rails g facebook_ads_for_spree:install
- Set
default_url_options
andasset_host
to point to your webserver and image server respectively. In simple configurations your image server and webserver will use the same hostname Add the following lines toconfig/environments/production.rb
:
config.action_controller.default_url_options = { host: 'YOUR_WEBSERVER_HOST_NAME', port: OPTIONAL_PORT }
config.action_controller.asset_host = "http://your.image.serving.host"
- Restart your server
If your server was running, restart it so that it can find the assets properly.
Go to administration UI and find 'Facebook settings' item in 'Configurations' menu. Click 'Connect to Facebook' button and go through the dialog in the popup window to complete your setup.
First bundle your dependencies, then run rake
. rake
will default to building the dummy app if it does not exist,
then it will run specs. The dummy app can be regenerated by using rake test_app
.
bundle
bundle exec rake
The gem is available as open source under the terms of the Facebook Platform License: https://developers.facebook.com/policy/