Installing Bufferloop Tracking Snippet
Instructions for Usage-
1. Include this file in index.html of your application as below.
<script src="https://api.bufferloop.com/static/bl-integration.js" crossorigin="anonymous"></script>
2. Now you can call createSignup and createTransaction functions from the application.
- window.btHandler.createSignup(name, email, identifier, signupType);
- window.btHandler.createTransaction(name, email, identifier, transactionType,
transactionIdentifier, amount, currency, productKey );
3. Both these functions are non-blocking fire and forget. You need worry or process about the
response. For eliminating any possibility of side effect, you could surround these calls with try catch.
4. All the attributes are of type text.
Signup Function
Usage -
window.btHandler.createSignup(name, email, identifier, signupType);
This function expects 4 parameters.
- Name – Customer Name
- Email – Email of the customer
- Identifier – This is the primary identifier of the customer in the Vendor Database. This key is used to
identify customer for a transaction. This ID needs to be sent in the createTransaction to associate
transaction with customer. In case of stripe webhook this id needs to be passed in metadata as
customer- key attribute - SignupType - This attribute is additional currently not in use and may be utilized in future.
Transaction Function
Usage -
window.btHandler.createTransaction(name, email, identifier, transactionType,
transactionIdentifier, amount, currency, productKey );
- Name – Customer Name
- Email – Email of the customer
- Identifier – This is the primary identifier of the customer in the Vendor Database. This is the key that
is sent in createSignup. If signup is not called before for this customer, then in bufferloop DB new
customer is created with this identifier. - transactionType - This attribute is additional currently not in use and may be utilized in future.
- TransactionIdentifier - This is primary identifier for transaction in vendor database. This will be used
to identify a transaction in bufferloop database. In case of stripe this identifier should be added in
meta-data for verification in webhook. - Amount – transaction amount
- Currency – USD
- ProductKey – Additional parameter to identify product for transaction.