-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generated gh-pages for commit db066cb
Author: Vitalii Oliinyk <[email protected]> [PR-22917][Documentation] Add segment to integration scripts (#340)
- Loading branch information
1 parent
d52062b
commit 709ee72
Showing
6 changed files
with
26 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,39 +4,4 @@ | |
Alternate Post Purchase Script for cart line item passing | ||
========================================================= | ||
|
||
.. code-block:: html | ||
|
||
<!-- Begin Talkable integration code --> | ||
<script> | ||
window._talkableq = window._talkableq || []; | ||
var _talkable_purchase_items = []; | ||
// Start for loop - iterate through cart and push details for each line item | ||
_talkable_purchase_items.push({ | ||
product_id: '', // Item Product ID. Example: 'sku0001' | ||
price: '', // Item Unit Price. Example: '199.00' | ||
quantity: '', // Item Quantity. Example: '1' | ||
title: '' // Name of a product. Example: 'Product Name' | ||
}); // End for loop | ||
var _talkable_data = { | ||
purchase: { | ||
order_number: '', // Required - Unique order number. Example: '100011' | ||
subtotal: '', // Required - Order subtotal (pre-tax, post-discount). Example: '23.97' | ||
coupon_code: '', // Coupon code that was used at checkout (pass multiple as an array). Example: 'SAVE20' | ||
currency_iso_code: '', // Required for multi-currency sites. Example: 'USD' | ||
items: _talkable_purchase_items, // Cart items declared in the example above | ||
shipping_zip: '', // Used for fraud protection by address. Example: '02222' | ||
shipping_address: '' // Full address of the order, make sure to strictly follow a format: 'Apt #, Street address, City, State, ZIP, Country' | ||
segment1: '', // Segment 1: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests). | ||
segment2: '', // Segment 2: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests). | ||
segment3: '', // Segment 3: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests). | ||
}, | ||
customer: { | ||
email: '', // Required - Email of the customer who issued a purchase. Example: '[email protected]' | ||
traffic_source: '' // The source of the traffic driven to the campaign. Example: 'facebook' | ||
} | ||
}; | ||
window._talkableq.push(['register_purchase', _talkable_data]); | ||
</script> | ||
<!-- End Talkable integration code --> | ||
.. include:: /partials/product_purchase_script.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,31 +112,7 @@ be passed as strings. A Number can be passed for `subtotal`, however, if | |
using any calculation, you’re responsible for ensuring that some number is | ||
passed where division by zero or `null` value does not occur. | ||
|
||
.. code-block:: html | ||
|
||
<!-- Begin Talkable integration code --> | ||
<script> | ||
window._talkableq = window._talkableq || []; | ||
var _talkable_data = { | ||
purchase: { | ||
order_number: '', // Required - Unique order number. Example: '100011' | ||
subtotal: '', // Required - Order subtotal (pre-tax, post-discount). Example: '23.97' | ||
coupon_code: '', // Coupon code that was used at checkout (pass multiple as an array). Example: 'SAVE20' | ||
currency_iso_code: '', // Required for multi-currency sites. Example: 'USD' | ||
shipping_zip: '', // Used for fraud protection by address. Example: '02222' | ||
shipping_address: '' // Full address of the order, make sure to strictly follow a format: 'Apt #, Street address, City, State, ZIP, Country' | ||
segment1: '', // Segment 1: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests). | ||
segment2: '', // Segment 2: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests). | ||
segment3: '', // Segment 3: Represents custom segment (e.g., location, age group, source channel, platform, gender, interests). | ||
}, | ||
customer: { | ||
email: '', // Required - Email of the customer who issued a purchase. Example: '[email protected]' | ||
traffic_source: '' // The source of the traffic driven to the campaign. Example: 'facebook' | ||
} | ||
}; | ||
window._talkableq.push(['register_purchase', _talkable_data]); | ||
</script> | ||
<!-- End Talkable integration code --> | ||
.. include:: /partials/purchase_script.rst | ||
|
||
Post Purchase Script Notes | ||
-------------------------- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,12 +120,12 @@ <h1>Including Product Items<a class="headerlink" href="#including-product-items" | |
|
||
<span class="w"> </span><span class="c1">// Start for loop</span> | ||
<span class="w"> </span><span class="nx">_talkable_purchase_items</span><span class="p">.</span><span class="nx">push</span><span class="p">({</span> | ||
<span class="w"> </span><span class="nx">product_id</span><span class="o">:</span><span class="w"> </span><span class="s1">'sku1'</span><span class="p">,</span><span class="w"> </span><span class="c1">// Required — Item Product ID</span> | ||
<span class="w"> </span><span class="nx">price</span><span class="o">:</span><span class="w"> </span><span class="s1">'199.00'</span><span class="p">,</span><span class="w"> </span><span class="c1">// Required — Item Unit Price</span> | ||
<span class="w"> </span><span class="nx">quantity</span><span class="o">:</span><span class="w"> </span><span class="s1">'1'</span><span class="p">,</span><span class="w"> </span><span class="c1">// Required — Item Quantity</span> | ||
<span class="w"> </span><span class="nx">title</span><span class="o">:</span><span class="w"> </span><span class="s1">'Awesome Product'</span><span class="p">,</span><span class="w"> </span><span class="c1">// Optional — Name of product</span> | ||
<span class="w"> </span><span class="nx">url</span><span class="o">:</span><span class="w"> </span><span class="s1">'http://www.store.com/product1'</span><span class="p">,</span><span class="w"> </span><span class="c1">// Optional — URL for product</span> | ||
<span class="w"> </span><span class="nx">image_url</span><span class="o">:</span><span class="w"> </span><span class="s1">'http://www.store.com/product1/image.jpg'</span><span class="w"> </span><span class="c1">// Optional — URL for product image</span> | ||
<span class="w"> </span><span class="nx">product_id</span><span class="o">:</span><span class="w"> </span><span class="s1">''</span><span class="p">,</span><span class="w"> </span><span class="c1">// Required — Item Product ID. Example: 'sku0001'</span> | ||
<span class="w"> </span><span class="nx">price</span><span class="o">:</span><span class="w"> </span><span class="s1">''</span><span class="p">,</span><span class="w"> </span><span class="c1">// Required — Item Unit Price. Example: '199.00'</span> | ||
<span class="w"> </span><span class="nx">quantity</span><span class="o">:</span><span class="w"> </span><span class="s1">''</span><span class="p">,</span><span class="w"> </span><span class="c1">// Required — Item Quantity. Example: '1'</span> | ||
<span class="w"> </span><span class="nx">title</span><span class="o">:</span><span class="w"> </span><span class="s1">''</span><span class="p">,</span><span class="w"> </span><span class="c1">// Optional — Name of product. Example: 'Product Name'</span> | ||
<span class="w"> </span><span class="nx">url</span><span class="o">:</span><span class="w"> </span><span class="s1">''</span><span class="p">,</span><span class="w"> </span><span class="c1">// Optional — URL for product. Example: 'http://www.store.com/product1'</span> | ||
<span class="w"> </span><span class="nx">image_url</span><span class="o">:</span><span class="w"> </span><span class="s1">''</span><span class="w"> </span><span class="c1">// Optional — URL for product image. Example: 'http://www.store.com/product1/image.jpg'</span> | ||
<span class="w"> </span><span class="p">});</span> | ||
<span class="w"> </span><span class="c1">// End for loop</span> | ||
|
||
|
@@ -138,6 +138,9 @@ <h1>Including Product Items<a class="headerlink" href="#including-product-items" | |
<span class="w"> </span><span class="nx">shipping_zip</span><span class="o">:</span><span class="w"> </span><span class="s1">''</span><span class="p">,</span><span class="w"> </span><span class="c1">// Used for fraud protection by address. Example: '02222'</span> | ||
<span class="w"> </span><span class="nx">shipping_address</span><span class="o">:</span><span class="w"> </span><span class="s1">''</span><span class="p">,</span><span class="w"> </span><span class="c1">// Full address of the order, make sure to strictly follow a format: 'Apt #, Street address, City, State, ZIP, Country'</span> | ||
<span class="w"> </span><span class="nx">items</span><span class="o">:</span><span class="w"> </span><span class="nx">_talkable_purchase_items</span><span class="w"> </span><span class="c1">// Cart items declared in the example above</span> | ||
<span class="w"> </span><span class="nx">segment1</span><span class="o">:</span><span class="w"> </span><span class="s1">''</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">''</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">''</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">''</span><span class="p">,</span><span class="w"> </span><span class="c1">// Required - Email of the customer who issued a purchase. Example: '[email protected]'</span> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.