Skip to main content

Lightweight connector of PlentyMarkets to Facebook Catalogs via a google-spreadsheet. Update product information regulary and import data to facebook.

Project description

facebook_feed_sync

Update a google sheet with data from the Plentymarkets API for a Facebook catalog feed.

Installation:

Prepare the folder structure and get google sheet API access

  1. Place the credentials file from : Google Sheet API as 'credentials.json' (example: mv ~/Downloads/credentials.json /home/$USER/.config/gspread/credentials.json) into the config folder for gspread.
  2. Place the config.ini file into the facebook_feed_sync config folder
    • Linux: /home/$USER/.config/facebook_feed_sync/config.ini
    • Windows: C:\\$USER\.config\facebook_feed_sync\config.ini

Here is an example for the config file:

[General]
google_sheet_id=
plenty_api_url=
lang=
[Mapping]
facebook_referrer=
image_match_criteria=
item_name_number=
gender_item_property=
age_item_property=
google_product_category_item_property=
material_variation_property=
url_variation_property=
sales_price_id=
color_attribute_id=
size_attribute_id=
main_warehouse=
  1. Get the ID of the target marketplace or Create a new marketplace availability:
    • {plenty-cloud-domain}/plenty/terra/system/orders/referrer
    • activate it and add the ID to the configuration.
  2. Set the marketplace availability for every variation you want to present on facebook.
  3. Create new variation or item properties(characteristics) for these fields or link existing properties:
    • Item properties (characteristics)
      {plenty-cloud-domain}/plenty/terra/system/item/character
      • gender_item_property [facebook: gender] (target audience gender: 'Men', 'Women', 'Unisex')
      • age_item_property [facebook: age_group] (target audience age group: 'Adult' or 'Child')
      • google_product_category_item_property [facebook: google_product_category] (Text value of your google product category, see: list)
    • Variation properties
      {plenty-cloud-domain}/plenty/terra/system/settings/properties/configuration/overview
      • material_variation_property [facebook: material] (material type of the product e.g. Cotton, Hemp etc.)
      • url_variation_property [facebook: link] (Link to your webshop)
  4. Choose the criteria by which valid pictures are chosen for each variation, the picture with the lowest position of the images found is used for Facebook.
    Example values: image_match_criteria=mandant;12345, image_match_criteria=marketplace;4.01.
  5. Add the IDs of the properties to the matching configuration entry
  6. Assign the facebook market availability to on of your prices: {plenty-cloud-domain}/plenty/terra/system/item/sales-price and make sure that all variations contain a price. Then add the ID of the price to the configuration field: sales_price_id
  7. Choose one of the three possible item names: name1, name2 or name3 and add the number of the name to the configuration field: item_name_number
  8. Assign the IDs of your color and size attribute to the configuration fields: color_attribute_id and size_attribute_id
  9. Assign the ID of the warehouse used for shipping to the configuration field: main_warehouse
  10. Fill the properties with values and then add the IDs of the properties to the configuration
  11. Create a google sheet and add the following header to it:
    • id,title,description,availability,inventory,condition,price,link,image_link,brand,google_product_category,sale_price,sale_price_effective_date,item_group_id,gender,color,size,age_group,material,pattern,product_type,shipping,shipping_weight
    • Insert the text then select the field and go to Data->Split text into columns
  12. Get your Google Sheet ID:
    • Example URL: https://docs.google.com/spreadsheets/d/{SHEET ID}/edit?pli=1#gid=0
    • Insert it into the configuration.
  13. Make an initial setup of the sheet with: python3 -m facebook_feed_sync -t all
  14. Check if the google sheet looks good and go on Share at the top right and change access rights to anyone with the link
  15. Go to your business manager (catalogs) https://business.facebook.com/products/catalogs/, create a new datafeed: Catalog -> data-feeds -> Add products -> Use bulk upload -> Google Spreadsheets -> Next -> Insert the full link -> Choose the upload schedule.
  16. Setup the cronjob to run the script preferably on a device, which has a constant uptime (I use a raspberry Pi for example), Notice cronjobs don't go well with the Keyring authentication, so please provide the credentials within the configuration like this:
    • Write the PlentyMarkets REST-API password into an empty file
    • encrypt it gpg --output test_file.gpg --encrypt --recipient {YOUR_GPG_RECIPIENT} test_file.txt
    • Add the PlentyMarkets REST-API username to the config under the section [Credentials] as option user
    • Add the path to the GnuPG encrypted file to the config under the section [Credentials] as option pw_file

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

facebook_feed_sync-0.2.1.tar.gz (26.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

facebook_feed_sync-0.2.1-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

Details for the file facebook_feed_sync-0.2.1.tar.gz.

File metadata

  • Download URL: facebook_feed_sync-0.2.1.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.7.3 Linux/5.10.0-rc1+

File hashes

Hashes for facebook_feed_sync-0.2.1.tar.gz
Algorithm Hash digest
SHA256 dae4942a110421c61184636102c2444a9d465ce9047db8a716d3fb59efbbf5a7
MD5 b237fb4ab43375567442ea4614b4c54f
BLAKE2b-256 c0ed83c8269a8d76c282a40912644d49296b23985c7a74bff405c5b4b24e8086

See more details on using hashes here.

File details

Details for the file facebook_feed_sync-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: facebook_feed_sync-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 27.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.7.3 Linux/5.10.0-rc1+

File hashes

Hashes for facebook_feed_sync-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 13d49011552f9b68ecc7980792f543d6413d12f8a410871d3a01217a4c4d70eb
MD5 9b292166197d40154c9552ab711c2585
BLAKE2b-256 7e144ea11181745b2f345af7499169c738dcdc207b83c926ae43d88fad8e942c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page