Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 1.91 KB

README.md

File metadata and controls

54 lines (40 loc) · 1.91 KB

FacebookAdsForSpree

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.

Installation

  1. 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'
  1. Install the gem using Bundler:
bundle install
  1. Copy & run migrations
bundle exec rails g facebook_ads_for_spree:install
  1. Set default_url_options and asset_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 to config/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"
  1. Restart your server

If your server was running, restart it so that it can find the assets properly.

Using

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.

Testing

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

License

The gem is available as open source under the terms of the Facebook Platform License: https://developers.facebook.com/policy/