Set Up Success Tracking on Your Website

Have you published your Product Finder yet? Publish your Product Finder first. Success tracking is the best way to follow the performance of your Product Finder. You want to do this to measure growth and understand how optimizing your Product Finder impacts your actual sales numbers with the success tracking reports. Are you using an eCommerce platform? Then setup is even faster.

Success tracking for other e-commerce platforms

Set up success tracking for Shopify

Are you not using an e-commerce platform? You can still integrate success tracking on your website in 3 easy steps.

  1. Embed the Success Tracking script in your webshop

  2. Invoke the trackPurchase method

  3. Pass the right attributes to the method

1. Embed the Success Tracking script in your webshop

Copy the script from the integration page of your Product Finder. The code should look something like the one below. Notice that your success tracking ID will be filled in.

<script type="text/javascript" src="https://api.productfinder360.com/api/v1/integrations/{{successtrackingID}}/pf360-tracking"></script>

Paste this code on the Thank You page of your webshop, preferably in its <head> section.

💡 The Thank You page is the page that shows up once a customer made a purchase. It thanks the users and confirms their order. 

2. Invoke the trackPurchase method

Make sure the trackPurchase method (Product Finder 360.Tracking.trackPurchase) is available from the global JavaScript scope of your Thank You page. 

Copy and paste the code below on your page as well. Remember to replace the variables with some code that links to your actual product data from your database.

ProductFinder360.Tracking.trackPurchase({
    transactionId: "12-abcde",
    currency: "USD",
    products: [
        {
            sku: {{sku}},
            name: {{name}},
            pricePerUnit: {{pricePerUnit}},
            quantity: {{quantity}},
            category: {{category}}
        }
});

Below is an example of what a result could be after these values were filled in. You can add more attributes, including custom parameters. That's up to you.

ProductFinder360.Tracking.trackPurchase({
    transactionId: "12-abcde",
    currency: "USD",
    products: [
        {
            sku: "abcd-1234-dc",
            name: "Organic Coffee Beans (Whole)",
            pricePerUnit: 8.50,
            quantity: 5,
            unit: "lb",
            listPrice: 10.00,
            marginPercentage: 27.5,
            discountPercentage: 15.0,
            category: "beverages",
            customParameters: {
                 flavor: "Unroasted",
                 origin: "Colombia",
            }
      }
 ],
  storeId: "US-TX-123",
  affiliation: "Brand",
  customParameters: {
       campaign: "New customer Discount 10% off"
  }
});

3. Pass the right attributes to the method

Make sure you invoke the trackPurchase method with the necessary transaction and product attributes. If the attribute is marked as "[Mandatory]", it must be defined. 

AttributeTypeDescription
Transaction attributes
transactionId[Mandatory] String, any value acceptedUnique ID of the transaction within your webshop
currency

[Mandatory] String, any value accepted but currency shortcodes com-pliant with ISO-4217 are recommended,e.g. USD, CHF, EUR

Currency of the transaction
products[Mandatory]JSON array, cannot be emptyContains information on the products purchased (see Product attributes below)
storeIdString, any value acceptedIdentifier of the store this transaction was made from, either online or physical
affiliationString, any value acceptedAffiliate that directed the customer to this product
customParame-tersJSON object, any valid valueMay contain any additional transaction data for your tracking purposes
Product attributes
name[Mandatory]String, any value acceptedName of the product purchased
sku[Mandatory]String, must match the product’s sku value in Product Finder 360Unique ID of this product, exactly as it appears in the product collection associated with your Product Finder 360 Product Finder
pricePerUnit[Mandatory]Number, any valid valueThe sales price of one item of this product
quantity[Mandatory]Number, any valid valueNumber of this specific item purchased within the transaction
unitString, any value acceptedMeasure of quantity, such as weight (e.g. ‘lb’or ‘kg’)
listPriceNumber, any valid valuePrice of this item in your product catalog
marginPercentageNumber, any valid valueYour margin on the product expressed in percentage. E.g. ‘27.5’on a $10 product means a margin of $2.75
discountPercentageNumber, any valid valueDiscount given per product, ex-pressed in percentage. E.g. ‘15’on a $10 product means a discount of 15%, so the customer pays $8.50
categoryString, any value accepted (there’s no validation, but filling this value for future analysis is recommended)Product category
customParametersJSON object, any valid value

May contain any additional product data for your tracking purposes

May contain any additional product data for your tracking purposes

That's all!🎉🎉🎉

Your Product Finder's sales data is being tracked. You find revenue generated in the Sales Reports dashboard per Product Finder in your account.

At this stage, you can check if everything is implemented correctly. Make a test purchase through your Product Finder. Click on a product that was recommended and do the payment for it. The data from this transaction should then be passed on to the sales report and to your dashboard