Skip to content

Commit

Permalink
Generated gh-pages for commit ee58d36
Browse files Browse the repository at this point in the history
Author: Hanna Rosul <[email protected]>

    [PR-22228] Describe how to pass preferred currency via JS integration (#332)
  • Loading branch information
Doimhneacht committed Aug 5, 2024
1 parent a45e961 commit 72619ab
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 2 deletions.
3 changes: 3 additions & 0 deletions _sources/advanced_features.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ each with links to integration details.
* - :ref:`White Labeling <advanced_features/white_labeling>`
- Change all visible URLs to your domain instead of talkable.com

* - :ref:`Multi-Currency <advanced_features/multi_currency>`
- Accept multiple currencies and set different rewards per currency

.. container:: hidden

.. toctree::
Expand Down
38 changes: 38 additions & 0 deletions _sources/advanced_features/multi_currency.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,44 @@ in the `[[ preferred_currency ]]` variable.

.. image:: /_static/img/advanced_features/multi_currency_advocate_offer.png

Passing visitor's preferred currency
....................................

If the preferred currency of the visitor is known, it can be passed as customer data to render the referral campaign
with the currency pre-selected:

.. code-block:: javascript
_talkableq.push(['authenticate_customer', {
email: '',
currency: 'AUD' // Currency should be an international 3-letter code as defined by the ISO 4217 standard
}]);
Currency can also be provided directly in any of the following function calls,
overriding the `authenticate_customer` data:

- `register_affiliate`
- `register_purchase`
- `register_event`

For example:

.. code-block:: javascript
var _purchase_data = {
purchase: {
order_number: '',
subtotal: '',
currency_iso_code: 'AUD' // currency of the purchase
},
currency: 'AUD', // preferred currency of the person, used to show suitable incentive information in the campaign
};
_talkableq.push(['register_purchase', _purchase_data]);
.. note::

Passing `currency` is available in integration version 5.2.1 or higher.

Currencies on dashboard
-----------------------

Expand Down
8 changes: 7 additions & 1 deletion advanced_features.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ <h1>Features<a class="headerlink" href="#features" title="Link to this heading">
<tr class="row-odd"><td><p><a class="reference internal" href="advanced_features/white_labeling.html#advanced-features-white-labeling"><span class="std std-ref">White Labeling</span></a></p></td>
<td><p>Change all visible URLs to your domain instead of talkable.com</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="advanced_features/multi_currency.html#advanced-features-multi-currency"><span class="std std-ref">Multi-Currency</span></a></p></td>
<td><p>Accept multiple currencies and set different rewards per currency</p></td>
</tr>
</tbody>
</table>
<div class="hidden docutils container">
Expand Down Expand Up @@ -392,7 +395,10 @@ <h1>Features<a class="headerlink" href="#features" title="Link to this heading">
<li class="toctree-l1"><a class="reference internal" href="advanced_features/multi_currency.html">Multi-currency</a><ul>
<li class="toctree-l2"><a class="reference internal" href="advanced_features/multi_currency.html#passing-currency-with-the-purchase-or-event">Passing currency with the purchase or event</a></li>
<li class="toctree-l2"><a class="reference internal" href="advanced_features/multi_currency.html#incentives-for-different-currencies">Incentives for different currencies</a></li>
<li class="toctree-l2"><a class="reference internal" href="advanced_features/multi_currency.html#preferred-currency">Preferred currency</a></li>
<li class="toctree-l2"><a class="reference internal" href="advanced_features/multi_currency.html#preferred-currency">Preferred currency</a><ul>
<li class="toctree-l3"><a class="reference internal" href="advanced_features/multi_currency.html#passing-visitor-s-preferred-currency">Passing visitor’s preferred currency</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="advanced_features/multi_currency.html#currencies-on-dashboard">Currencies on dashboard</a></li>
<li class="toctree-l2"><a class="reference internal" href="advanced_features/multi_currency.html#currencies-in-reports">Currencies in reports</a></li>
</ul>
Expand Down
36 changes: 36 additions & 0 deletions advanced_features/multi_currency.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,42 @@ <h2>Preferred currency<a class="headerlink" href="#preferred-currency" title="Li
<p>Talkable allows storing an Advocate’s or Friend’s preferred currency. The selected currency can be accessed in <a rel="nofollow" href="https://github.com/Shopify/liquid" target="_blank">Liquid</a>
in the <cite>[[ preferred_currency ]]</cite> variable.</p>
<img alt="../_images/multi_currency_advocate_offer.png" src="../_images/multi_currency_advocate_offer.png" />
<section id="passing-visitor-s-preferred-currency">
<h3>Passing visitor’s preferred currency<a class="headerlink" href="#passing-visitor-s-preferred-currency" title="Link to this heading"></a></h3>
<p>If the preferred currency of the visitor is known, it can be passed as customer data to render the referral campaign
with the currency pre-selected:</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="nx">_talkableq</span><span class="p">.</span><span class="nx">push</span><span class="p">([</span><span class="s1">&#39;authenticate_customer&#39;</span><span class="p">,</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nx">email</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;&#39;</span><span class="p">,</span>
<span class="w"> </span><span class="nx">currency</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;AUD&#39;</span><span class="w"> </span><span class="c1">// Currency should be an international 3-letter code as defined by the ISO 4217 standard</span>
<span class="p">}]);</span>
</pre></div>
</div>
<p>Currency can also be provided directly in any of the following function calls,
overriding the <cite>authenticate_customer</cite> data:</p>
<blockquote>
<div><ul class="simple">
<li><p><cite>register_affiliate</cite></p></li>
<li><p><cite>register_purchase</cite></p></li>
<li><p><cite>register_event</cite></p></li>
</ul>
</div></blockquote>
<p>For example:</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="kd">var</span><span class="w"> </span><span class="nx">_purchase_data</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nx">purchase</span><span class="o">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nx">order_number</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;&#39;</span><span class="p">,</span>
<span class="w"> </span><span class="nx">subtotal</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;&#39;</span><span class="p">,</span>
<span class="w"> </span><span class="nx">currency_iso_code</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;AUD&#39;</span><span class="w"> </span><span class="c1">// currency of the purchase</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nx">currency</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;AUD&#39;</span><span class="p">,</span><span class="w"> </span><span class="c1">// preferred currency of the person, used to show suitable incentive information in the campaign</span>
<span class="p">};</span>
<span class="nx">_talkableq</span><span class="p">.</span><span class="nx">push</span><span class="p">([</span><span class="s1">&#39;register_purchase&#39;</span><span class="p">,</span><span class="w"> </span><span class="nx">_purchase_data</span><span class="p">]);</span>
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Passing <cite>currency</cite> is available in integration version 5.2.1 or higher.</p>
</div>
</section>
</section>
<section id="currencies-on-dashboard">
<h2>Currencies on dashboard<a class="headerlink" href="#currencies-on-dashboard" title="Link to this heading"></a></h2>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit 72619ab

Please sign in to comment.