Jump to content

Adding Affiliate visitor tracking JavaScript


battles

Recommended Posts

I'm trying out an affiliate program and it needs some custom JS added to the home page and to the thank you page:

Tracking Visitors
To track visitors, copy and paste the following code just above </body> on your website.

Tracking Purchases
Tracking purchases can be accomplished by adding the following javascript on your Thank You page.

I'm relatively sure that I will add the Purchade script to:  /templates/orderforms/cart/complete.tpl

Where would the visitor tracking go?

Also it needs to be wrapped in - {literal} {/literal} , correct?

Is there a custom js file I should add and call so it doesn't get overwritten by updates?

 

 

Link to comment
Share on other sites

if you want to avoid changes getting overwritten due to updating, then you'd be better off using hooks rather than editing the templates.

13 minutes ago, battles said:

To track visitors, copy and paste the following code just above </body> on your website.

that's usually a ClientAreaFooterOutput hook.

15 minutes ago, battles said:

Tracking purchases can be accomplished by adding the following javascript on your Thank You page.

that's a ShoppingCartCheckoutCompletePage hook.

there should be plenty of examples hooks previously posted to cover both parts - they can be put in the same .php file.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated