Jump to content

Tapfiliate conversion tracking issue REST API

Recommended Posts

Hello! I have Tapfiliate integrated and working with our Squarespace website, however, we are only able to track conversions that come through a referral link. We require the ability to also track conversions when a discount code is used. Tapfiliate's support has advised us this is possible through the rest api and supplied their dev docs, "Create a Conversion":

https://tapfiliate.com/docs/rest/#conversions-conversions-collection-post

 

We have hired a front-end developer but he has been unable to resolve this issue. Any insight or help into this would be greatly appreciated, we have been working to resolve this since January.

Link to comment
11 hours ago, Alexandherpixels said:

Hello! I have Tapfiliate integrated and working with our Squarespace website, however, we are only able to track conversions that come through a referral link. We require the ability to also track conversions when a discount code is used. Tapfiliate's support has advised us this is possible through the rest api and supplied their dev docs, "Create a Conversion":

https://tapfiliate.com/docs/rest/#conversions-conversions-collection-post

 

We have hired a front-end developer but he has been unable to resolve this issue. Any insight or help into this would be greatly appreciated, we have been working to resolve this since January.

Did you integrate Tapfiliate with Squarespace commerce or Acuity? To call the REST API you need to user 3rd service, previously I used Autocode webhooks because they have free generous tier, but now it is gone.

I think we can also use Cloudflare for this matter

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
Posted (edited)
3 hours ago, Beyondspace said:

Did you integrate Tapfiliate with Squarespace commerce or Acuity? To call the REST API you need to user 3rd service, previously I used Autocode webhooks because they have free generous tier, but now it is gone.

I think we can also use Cloudflare for this matter

We integrated Tapfiliate with Squarespace Commerce.

Regarding Autocode or Cloudfare, can you elaborate on what is needed from the 3rd party in order to make this work? I have a very very basic understanding of Javascript but since our developer is also stumped, I'm trying to do as much research/learning to aid this process as I can.

I really appreciate your time!

 

*editing to add: the only transaction data we need is the discount code used, and the order total. I had hoped this meant we would not need a secure API key as I understand that can be an issue with Squarespace, but please correct me if I am wrong.

Edited by Alexandherpixels
Link to comment
2 hours ago, Alexandherpixels said:

We integrated Tapfiliate with Squarespace Commerce.

Regarding Autocode or Cloudfare, can you elaborate on what is needed from the 3rd party in order to make this work? I have a very very basic understanding of Javascript but since our developer is also stumped, I'm trying to do as much research/learning to aid this process as I can.

I really appreciate your time!

 

*editing to add: the only transaction data we need is the discount code used, and the order total. I had hoped this meant we would not need a secure API key as I understand that can be an issue with Squarespace, but please correct me if I am wrong.

Order data is actually available on Order status page, can you create a 100% discount so I can make a test order to confirm the available on Order confirmation page?

Last time I used 3rd party service to make API call to Acuity server and retrieve Acuity order info

image.thumb.png.bebbd1f4a79014dcd059e4dfb79452ec.png

Edited by Beyondspace

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
Posted (edited)
35 minutes ago, Beyondspace said:

Order data is actually available on Order status page, can you create a 100% discount so I can make a test order to confirm the available on Order confirmation page?

Last time I used 3rd party service to make API call to Acuity server and retrieve Acuity order info

image.thumb.png.bebbd1f4a79014dcd059e4dfb79452ec.png

I'm not sure if this helps, but this is Tapfiliate's Squarespace integration code (referral link tracking only) that is injected into the order confirmation and order status page:

<script src="https://script.tapfiliate.com/tapfiliate.js" type="text/javascript" async></script>
<script type="text/javascript">
    (function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){
    (t[a].q=t[a].q||[]).push(arguments)}})(window,'tap');

    tap('create', '47272-f7587c', { integration: "squarespace" });
    tap('conversion', '{orderId}', {orderSubtotal}, {'customer_id': '{customerEmailAddress}'});
</script>



This is the latest version of code our developer tried, also injected into the order status and confirmation pages, but he was unable to get it working:

<script src="https://script.tapfiliate.com/tapfiliate.js" type="text/javascript" async></script>
<script type="text/javascript">
    (function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){
    (t[a].q=t[a].q||[]).push(arguments)}})(window,'tap');

    tap('create', '47272-f7587c', { integration: "squarespace" });
    tap('conversion', '{orderId}', {orderSubtotal}, {'customer_id': '{customerEmailAddress}'});
(function () {
  document
    .querySelectorAll('[data-test="gift-and-promo-code-input"]')
    .forEach((inputField) => {
      inputField.addEventListener("input", function (ev) {
        tap("click", { code: ev.target.value }, (err, res) => {
          console.log({ error: err, result: res });
        });
      });
    });
})();
</script>

Edited by Alexandherpixels
Link to comment
20 minutes ago, Alexandherpixels said:

Here's a code you can use: TFTEST2

Thank you so much!

Which site?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

I see, the detail order also did not available on my end too. 

Also this part won't work because it trying to query the promo code on checkout page

Quote

 document.querySelectorAll('[data-test="gift-and-promo-code-input"]')

So we can use Cloudflare as external service to query Squarespace orders and using OrderId (this is incorrect name, the value in Order confirmation page is OrderNumber)

- Squarespace Orders API help you retrieve Squarespace order programatically

- In order to user it on 3rd party you will need an API key. Note that you will need Commerce Advanced or higher to use the Orders API

In Cloudflare workers when you create a worker it will be available as an endpoint, for example https://api.squarespace-order.workers.dev/, once user lands on Order confirmation page you will make a request to that endpoint with the OrderId value

Next step is tricky part, since Orders API can return a specific Order based on its ID, but it is not the same with OrderId on Confirmation page which actually is OrderNumber!

So you got to use the All Orders api to get all order in specific time and filter based on the given OrderNumber and return the matched order, which will contain the Discount code line

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
15 hours ago, Beyondspace said:

I see, the detail order also did not available on my end too. 

Also this part won't work because it trying to query the promo code on checkout page

So we can use Cloudflare as external service to query Squarespace orders and using OrderId (this is incorrect name, the value in Order confirmation page is OrderNumber)

- Squarespace Orders API help you retrieve Squarespace order programatically

- In order to user it on 3rd party you will need an API key. Note that you will need Commerce Advanced or higher to use the Orders API

In Cloudflare workers when you create a worker it will be available as an endpoint, for example https://api.squarespace-order.workers.dev/, once user lands on Order confirmation page you will make a request to that endpoint with the OrderId value

Next step is tricky part, since Orders API can return a specific Order based on its ID, but it is not the same with OrderId on Confirmation page which actually is OrderNumber!

So you got to use the All Orders api to get all order in specific time and filter based on the given OrderNumber and return the matched order, which will contain the Discount code line

Thank you for this detailed reply. I'm not sure I can code a solution, but I'll forward this on to our developer! I've also sent you a PM 🙂

Link to comment
7 hours ago, Alexandherpixels said:

Thank you for this detailed reply. I'm not sure I can code a solution, but I'll forward this on to our developer! I've also sent you a PM 🙂

Sure I just replied

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.