Post by plusnfab » Thu Jan 25, 2024 7:15 pm

Hi,
need assistance in resolving the following JS

Code: Select all

<script type="text/javascript">
      window.goaffpro_order = {
        number : "#1001",
        total: 1000
      }
      if(typeof window.goaffproTrackConversion !== "undefined"){
        window.goaffproTrackConversion(window.goaffpro_order)
      }
    </script>
The goaffproOrder object must conform to the following schema
Key : number Value : The order number
key : total value : Total order amount

Code: Select all

<script type="text/javascript">
    window.goaffpro_order = {
      number: {{ order_id }},
      total: {{ order.total }
};

    if (typeof window.goaffproTrackConversion !== "undefined") {
      window.goaffproTrackConversion(window.goaffpro_order);
    }
  </script>
Its not working, what am I missing here.

Newbie

Posts

Joined
Thu Jan 25, 2024 10:16 am

Post by paulfeakins » Thu Jan 25, 2024 8:22 pm

plusnfab wrote:
Thu Jan 25, 2024 7:15 pm
Its not working, what am I missing here.
Hard to say without more info but perhaps you order number should be numeric i.e.

Code: Select all

number: 1000
Rather than:

Code: Select all

number: "#1000"
Just a guess though as there isn't much to go on.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by Larrymcree » Tue Feb 13, 2024 4:05 pm

It seems that you are trying to integrate GoAffPro, an affiliate marketing app, with your OpenCart store. GoAffPro provides a custom SDK for tracking conversions and referrals from your affiliates. You need to add the SDK script to all the pages of your store, and the conversion script to the order thank you page. According to the GoAffPro documentation, the goaffpro_order object must have the following properties:
number: The order number (required)
total: The order total (required)
id: The internal order ID (optional)
subtotal_price: The order subtotal (optional)
total_discounts: The total discount given on the order (optional)
email: The email address of the customer (optional)
In your code, you have used total instead of total_price, which may cause the conversion tracking to fail. You also need to make sure that the values of number and total are dynamically populated from the OpenCart order variables. For example, you can use {{ order.order_id }} and {{ order.total }} to get the order number and total, respectively. Dog Likes Best
Here is an example of how your conversion script should look like:

Code: Select all

<script type="text/javascript">
    window.goaffpro_order = {
      number: {{ order.order_id }},
      total_price: {{ order.total }}
    };

    if (typeof window.goaffproTrackConversion !== "undefined") {
      window.goaffproTrackConversion(window.goaffpro_order);
    }
  </script>

Newbie

Posts

Joined
Tue Feb 13, 2024 4:00 pm
Who is online

Users browsing this forum: No registered users and 7 guests