Select Page
Methods Documentation
Edit on
Codepen.io

fastspring.builder.tag({“key”:”value”,”key2″:”value2″})

Takes one or more key and value pairs as input, applies tag(s) to the session.
Note: The key and value pairs must be supplied using valid JSON formatting, as in the example here.
Note: The sum of the number of characters supplied for the key and the value must not exceed approximately 4,000 characters.


x
38
 
1
<!--
2
    DEMO INFO
3
    fastspring.builder.tag() allows you to attach custom order level tags
4
    as key value pairs to orders.
5
-->
6
<button id="push-button" onclick="fastspring.builder.tag({'myKey':'myValue'});">Add Tag</button>
7
8
<!--
9
    DEMO EFFECTS
10
-->
11
<br /><br />
12
<div>
13
    Order Level Tags: <span id="key"></span>
14
</div>
15
16
<!--
17
    DEMO SETUP
18
        - Initialize the Store Builder Library
19
        - data-data-callBack function that allows us to parse the response and
20
          display the tags that were attached to the order
21
-->
22
<script
23
    id="fsc-api"
24
    src="https://sbl.onfastspring.com/sbl/1.0.2/fastspring-builder.min.js"
25
    type="text/javascript"
26
    data-storefront="fastspringexamples.test.onfastspring.com/popup-fastspringexamples"
27
    data-data-callback="dataCallbackFunction">
28
</script>
29
30
<script type="text/javascript">
31
    function dataCallbackFunction(fsdata)
32
    {                            
33
        if (fsdata.tags)
34
        {
35
            document.getElementById("key").append(JSON.stringify(fsdata.tags));
36
        }
37
    }
38
</script>
1
 
1
1
 
1

Related Topics