Skip to content

Commit

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

    [PR-21747] [Segments] Update documentation for authenticate_customer and AffiliateMember case (#345)
  • Loading branch information
Buritos16 committed Nov 19, 2024
1 parent e2428a2 commit 1f7d44c
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 52 deletions.
52 changes: 25 additions & 27 deletions _sources/advanced_features/segments.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,33 +76,31 @@ For individual purchase segmentation, you have the option to utilize three custo
Each of these segments can represent various criteria such as location, age group, traffic source, etc.
These segments offer flexibility in categorizing purchases based on different customer characteristics or transaction attributes.

Example of usage:

.. code-block:: html

<!-- Begin Talkable integration code -->
<script>
window._talkableq = window._talkableq || [];
var _talkable_data = {
purchase: {
order_number: '100011', // Unique order number
subtotal: '23.97', // Order subtotal
coupon_code: 'SAVE20', // Coupon code used at checkout
currency_iso_code: 'USD', // Currency code
shipping_zip: '02222', // Shipping ZIP code
shipping_address: 'Apt 123, 456 Street, Cityville, CA, 02222, USA', // Shipping address
segment1: 'CA', // Custom segment 1
segment2: 'female', // Custom segment 2
segment3: 'social-media' // Custom segment 3
},
customer: {
email: '[email protected]'
traffic_source: 'facebook'
}
};
window._talkableq.push(['register_purchase', _talkable_data]);
</script>
<!-- End Talkable integration code -->
Example of usage with `register_purchase`:

.. include:: /partials/purchase_script.rst

Example of usage with `authenticate_customer`:

.. code-block:: javascript
window._talkableq.push(['authenticate_customer', {
email: '', // Email of the customer. Example: '[email protected]'
first_name: '', // First name of the customer. Example: 'John'
last_name: '', // Last name of the customer. Example: 'Doe'
traffic_source: '', // The source of the traffic driven to the campaign. Example: 'facebook'
segment1: '', // Custom segment (e.g., location, age group, source channel, platform, gender, interests).
segment2: '', // Custom segment (e.g., location, age group, source channel, platform, gender, interests).
segment3: '' // Custom segment (e.g., location, age group, source channel, platform, gender, interests).
}]);
In this example, `segment1`, `segment2`, and `segment3` attributes are passed through `authenticate_customer` to enable segmentation without requiring an Origin creation.

.. note::

Segments can also be passed in `register_affiliate`, `register_purchase`, and `register_event`, providing flexibility for different integration scenarios.

This approach simplifies custom data handling for customers, allowing for unified data across various methods and optimizing segmentation management without additional calls.

.. container:: hidden

Expand Down
21 changes: 16 additions & 5 deletions _sources/integration/custom/integration_components.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,26 @@ script.
window._talkableq = window._talkableq || [];
window._talkableq.unshift(['init', { site_id: '<YOUR-TALKABLE-SITE-ID>' }]);
window._talkableq.push(['authenticate_customer', {
email: '', // Optional, pass when available. Example: '[email protected]'
phone_number: '', // Optional, pass when available. Example: '+12025551111'
first_name: '', // Optional, pass when available. Example: 'John'
last_name: '', // Optional, pass when available. Example: 'Smith'
traffic_source: '' // Optional, the source of the traffic driven to the campaign. Example: 'facebook'
email: '', // Optional - Email of the customer, if available. Example: '[email protected]'
phone_number: '', // Optional - Customer's phone number. Example: '+12025551111'
first_name: '', // Optional - First name of the customer. Example: 'John'
last_name: '', // Optional - Last name of the customer. Example: 'Smith'
traffic_source: '', // Optional - Traffic source that led to the campaign. Example: 'facebook'
segment1: '', // Optional - Custom segment (e.g., location, age group, source channel, platform, gender, interests).
segment2: '', // Optional - Custom segment (e.g., location, age group, source channel, platform, gender, interests).
segment3: '' // Optional - Custom segment (e.g., location, age group, source channel, platform, gender, interests).
}]);
</script>
<!-- End Talkable integration code -->

In this example, `segment1`, `segment2`, and `segment3` attributes are passed through `authenticate_customer` to enable segmentation without requiring an Origin creation.

.. note::

Segments can also be passed in `register_affiliate`, `register_purchase`, and `register_event`, providing flexibility for different integration scenarios.

This approach simplifies custom data handling for customers, allowing for unified data across various methods and optimizing segmentation management without additional calls.

Initialization Script Notes
---------------------------

Expand Down
46 changes: 32 additions & 14 deletions advanced_features/segments.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,34 +172,52 @@ <h2>Custom Segments<a class="headerlink" href="#custom-segments" title="Link to
<p>For individual purchase segmentation, you have the option to utilize three custom segments: <cite>segment1</cite>, <cite>segment2</cite>, <cite>segment3</cite>.
Each of these segments can represent various criteria such as location, age group, traffic source, etc.
These segments offer flexibility in categorizing purchases based on different customer characteristics or transaction attributes.</p>
<p>Example of usage:</p>
<blockquote>
<div><div class="highlight-html notranslate"><div class="highlight"><pre><span></span><span class="cm">&lt;!-- Begin Talkable integration code --&gt;</span>
<p>Example of usage with <cite>register_purchase</cite>:</p>
<div class="highlight-html notranslate"><div class="highlight"><pre><span></span><span class="cm">&lt;!-- Begin Talkable integration code --&gt;</span>
<span class="p">&lt;</span><span class="nt">script</span><span class="p">&gt;</span>
<span class="w"> </span><span class="nb">window</span><span class="p">.</span><span class="nx">_talkableq</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">window</span><span class="p">.</span><span class="nx">_talkableq</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="p">[];</span>
<span class="w"> </span><span class="kd">var</span><span class="w"> </span><span class="nx">_talkable_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;100011&#39;</span><span class="p">,</span><span class="w"> </span><span class="c1">// Unique order number</span>
<span class="w"> </span><span class="nx">subtotal</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;23.97&#39;</span><span class="p">,</span><span class="w"> </span><span class="c1">// Order subtotal</span>
<span class="w"> </span><span class="nx">coupon_code</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;SAVE20&#39;</span><span class="p">,</span><span class="w"> </span><span class="c1">// Coupon code used at checkout</span>
<span class="w"> </span><span class="nx">currency_iso_code</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;USD&#39;</span><span class="p">,</span><span class="w"> </span><span class="c1">// Currency code</span>
<span class="w"> </span><span class="nx">shipping_zip</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;02222&#39;</span><span class="p">,</span><span class="w"> </span><span class="c1">// Shipping ZIP code</span>
<span class="w"> </span><span class="nx">shipping_address</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;Apt 123, 456 Street, Cityville, CA, 02222, USA&#39;</span><span class="p">,</span><span class="w"> </span><span class="c1">// Shipping address</span>
<span class="w"> </span><span class="nx">segment1</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;CA&#39;</span><span class="p">,</span><span class="w"> </span><span class="c1">// Custom segment 1</span>
<span class="w"> </span><span class="nx">segment2</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;female&#39;</span><span class="p">,</span><span class="w"> </span><span class="c1">// Custom segment 2</span>
<span class="w"> </span><span class="nx">segment3</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;social-media&#39;</span><span class="w"> </span><span class="c1">// Custom segment 3</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="c1">// Required - Unique order number. Example: &#39;100011&#39;</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="c1">// Required - Order subtotal (pre-tax, post-discount). Example: &#39;23.97&#39;</span>
<span class="w"> </span><span class="nx">coupon_code</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="c1">// Coupon code that was used at checkout (pass multiple as an array). Example: &#39;SAVE20&#39;</span>
<span class="w"> </span><span class="nx">currency_iso_code</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="c1">// Required for multi-currency sites. Example: &#39;USD&#39;</span>
<span class="w"> </span><span class="nx">shipping_zip</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="c1">// Used for fraud protection by address. Example: &#39;02222&#39;</span>
<span class="w"> </span><span class="nx">shipping_address</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;&#39;</span><span class="w"> </span><span class="c1">// Full address of the order, make sure to strictly follow a format: &#39;Apt #, Street address, City, State, ZIP, Country&#39;</span>
<span class="w"> </span><span class="nx">segment1</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="c1">// Segment 1: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests).</span>
<span class="w"> </span><span class="nx">segment2</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="c1">// Segment 2: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests).</span>
<span class="w"> </span><span class="nx">segment3</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="c1">// Segment 3: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests).</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nx">customer</span><span class="o">:</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;[email protected]&#39;</span>
<span class="w"> </span><span class="nx">traffic_source</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;facebook&#39;</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="c1">// Required - Email of the customer who issued a purchase. Example: &#39;[email protected]&#39;</span>
<span class="w"> </span><span class="nx">traffic_source</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;&#39;</span><span class="w"> </span><span class="c1">// The source of the traffic driven to the campaign. Example: &#39;facebook&#39;</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">};</span>
<span class="w"> </span><span class="nb">window</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">_talkable_data</span><span class="p">]);</span>
<span class="p">&lt;/</span><span class="nt">script</span><span class="p">&gt;</span>
<span class="cm">&lt;!-- End Talkable integration code --&gt;</span>
</pre></div>
</div>
<p>Example of usage with <cite>authenticate_customer</cite>:</p>
<blockquote>
<div><div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="nb">window</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;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="c1">// Email of the customer. Example: &#39;[email protected]&#39;</span>
<span class="w"> </span><span class="nx">first_name</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="c1">// First name of the customer. Example: &#39;John&#39;</span>
<span class="w"> </span><span class="nx">last_name</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="c1">// Last name of the customer. Example: &#39;Doe&#39;</span>
<span class="w"> </span><span class="nx">traffic_source</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="c1">// The source of the traffic driven to the campaign. Example: &#39;facebook&#39;</span>
<span class="w"> </span><span class="nx">segment1</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="c1">// Custom segment (e.g., location, age group, source channel, platform, gender, interests).</span>
<span class="w"> </span><span class="nx">segment2</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="c1">// Custom segment (e.g., location, age group, source channel, platform, gender, interests).</span>
<span class="w"> </span><span class="nx">segment3</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;&#39;</span><span class="w"> </span><span class="c1">// Custom segment (e.g., location, age group, source channel, platform, gender, interests).</span>
<span class="p">}]);</span>
</pre></div>
</div>
</div></blockquote>
<p>In this example, <cite>segment1</cite>, <cite>segment2</cite>, and <cite>segment3</cite> attributes are passed through <cite>authenticate_customer</cite> to enable segmentation without requiring an Origin creation.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Segments can also be passed in <cite>register_affiliate</cite>, <cite>register_purchase</cite>, and <cite>register_event</cite>, providing flexibility for different integration scenarios.</p>
</div>
<p>This approach simplifies custom data handling for customers, allowing for unified data across various methods and optimizing segmentation management without additional calls.</p>
<div class="hidden docutils container">
<div class="toctree-wrapper compound">
</div>
Expand Down
Loading

0 comments on commit 1f7d44c

Please sign in to comment.