• Resolved Rebecca L

    (@rebeccall)


    Just a quick one. We’ve been given a external JS API code to add to our website. It needs to trigger just on the order confirmation page to plant a tree for that order.

    I’ve tried to add the API using this plugin with the following settings:

    Auto Insert
    Site Wide Header
    Any device type
    Enable logic
    Show if page URL contains /checkout/order-received

    I’ve also tried ‘Insert before content’

    Both ways do include the API JS on the confirmation page (Inspect > Network) – however it doesn’t look like it responds with anything.

    I’ve checked for a response using the ‘tree impact API’ and can see it is not working.

    I just wondered if this plugin can be used to insert external API?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @rebeccall,

    Including that type of script is definitely supported but please make sure you are using the correct snippet code type. If your code is already provided with <script> tags you should use the code type HTML, if it’s just JS code you should use the code type JavaScript.

    For quicker debugging, I would suggest first loading the script on a regular page to confirm it is working and then enabling the conditional logic rules.

    If you still can’t get the code to work please reach out using the form at https://wpcode.com/contact so that you can privately share the code with us to see if we can provide further help.

    Thread Starter Rebecca L

    (@rebeccall)

    Thank you! I will continue to test and reach out if it still doesn’t work.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can this be used to add external API to a page?’ is closed to new replies.