There are 3 ways to attach rich data (image, price, etc) to shares:

1. By using tagging your pages with Product Schema code.

2. By adding Javascript variables to the Social Analytics footer code.

3. Facebook OG Tags.

Method #1 - Product Schema (recommended)

Mark up your pages with schema.org/Product tags.

For a quick implementation (actually marking up your pages is recommended), add this code to your product view template, replacing with the correct variables. All values are optional.

    PRODUCT NAME VARIABLE HERE
    PRODUCT DESCRIPTION VARIABLE HERE
    
     
        PRODUCT PRICE HERE
        ​
     
     
        PRODUCT RATING HERE
        NUMBER OF RATINGS
        LOWEST POSSIBLE RATING
        HIGHEST POSSIBLE RATING
   
 

NOTE: We might already have the correct Product Schema codes for your eCommerce platform: AddShoppers Product Schema Codes

Here's a live example of a page with correct Product Schema markup. Check the source to see how it's done!

Method #2 - Javascript Variables

The AddShoppersTracking variable in your Social Analytics code can accommodate the following attributes:

AddShoppersTracking = { 
          url: '', 
          name: '', 
          image: '', 
          description: '', 
          stock: '', 
          price: '', 
          rating: '' 
     }

Just add the correct variables next to the corresponding attribute (again, all are optional).

Here's a live example of a page using AddShoppersTracking to tag rich product data. Check the source to see the AddShoppersTracking object.

Please note that once the AddShoppers widget loads, changes to AddShoppersTracking will have no effect UNLESS you reload the widget by calling AddShoppersWidget.onload();.

Method #3 - Facebook OG Tags

If none of the methods above are detected, we will also pick up Facebook OG tags, if available. We'll pick up the og:image, og:description, and og:title tags. You cannot specify product price, rating, and stock status with this method, so the other 2 methods are recommended.

Did this answer your question?