This page last changed on Feb 23, 2012 by jed.wheeler@involver.com.

Overview

Note: Gifts tag is now supported in Facebook iframes. Currently only the default view for gifts is supported. This can be obtained with the following sml code:

{% gifts name:"your_custom_name" %}{% endgifts %}

The Gifts feature allows a user to select a gift and post the selected gift to a friend's wall. A gift is defined as a gift icon image, caption, and description. Additionally, the gift must have an action link text and URL.


Configuration

To use this feature, you must add gifts.

Gifts can be added on the settings page. To get to the settings page, paste the following default SML code into the Template Editor and save:

{% gifts name:"your_custom_name" %}{% endgifts %}

You will see the 'gifts' feature appear in your "Feature" table. Click the 'Configure' link in the 'gifts' feature row and you should the following:

Clicking the 'Add A New Gift' button will open the form:  

The following illustration shows where each gift's attributes map on the wall post, as well as their validation constraints.

Cannot resolve external resource into attachment.


Caching Considerations

No special caching considerations.


Attributes

name type required description
name string false This is a name to identify the specific feature instance that you are using in your template code. This is useful if you have multiple instances of the same feature on the same page. Note: By default, the SML will look for a nick name of "default" if you do not specify one in the tag definition.

Context Variables

name type description
gift_items Array Returns an Array of gift_items.

Examples

Simple Example

Create a call to action to the gifts dialog:

{% gifts name:"pizza_gifter" %}
  {% gifts_form_link %}Share a Pizza{% endgifts_form_link %}
{% endgifts %}

This will wrap "Share a Pizza" with an anchor, turning it into a call to action.
When the user clicks that link, they will see a dialog box. The user can select a gift, friend, and write an optional message. Cannot resolve external resource into attachment.

Note: The form automatically validates that the user selected a gift and recipient. 

Now, the user can post the gift to the friend's wall through Facebook's publish feature:
Cannot resolve external resource into attachment.

The story will appear on the friend's feed, like so:

Cannot resolve external resource into attachment.

Complex Example

Show the gifts:

{% gifts name:"pizza_gifter" %}
  <ul>
  {% for gift in gifts.gift_items %}
    <li>
      <p><img src="{{gift.image_url}}" alt=""></p>
      <p>{{gift.title}}</p>
    </li>
  {% endfor %}
  </ul>
{% endgifts %}

Specify a custom CSS class name for the anchor:

{% gifts name:"pizza_gifter" %}
     {% gifts_form_link class:"pizza-share-cta" %}Share a Pizza{% endgifts_form_link %}
{% endgifts %}

Specify the title of the gifts dialog:

{% gifts name:"pizza_gifter" %}
     {% gifts_form_link dialog_title:"Share a Pizza" %}Share a Pizza{% endgifts_form_link %}
{% endgifts %}

FAQ

  1. How do I add gifts?
    To add gifts, go to the gifts settings page by clicking the pencil icon next to the feature in the features table. You may add as many gifts as you'd like.
  2. What analytics are tracked?
    1. Number of clicks on the gifts_form_link. This will appear in the Application Summary Report.
    2. Number of shares per gift. This will appear in the Application Summary Report. (Note: this analytics column uses the title of the gift. If the title is the same for multiple gifts, they will be tracked under the same column.)

Related Topics


gifts 1.jpg (image/jpeg)
gifts2.jpg (image/jpeg)
Document generated by Confluence on Feb 12, 2013 09:09