How to manually add tracking code to WordPress sites

In order to integrate Affiliatly with your WordPress site, we'll need to inject your Affiliatly account's script to your store's footer.

There are different ways of doing this but we invested time in researching the easiest one and it's via a plugin we tested. You might be doubtful about adding another plugin to your store, but for injecting the code there are some big benefits:

  • Your code snippets will remain intact if you ever switch themes.
  • The plugin makes it easy to only add code snippets to the header or footer of your homepage, which can be helpful in some use cases.
  • The plugin is more beginner-friendly because it doesn’t require digging into the code.

As preparation, we do need to have at hand your Affiliatly account's script. You can find it under the "integration" tab on your Affiliatly account.

Affiliatly tracking codeNow that we have it, let's get started with the process!

1. Go to your WordPress Dashboard

2. Click on Plugins

Wordpress dashboard

3. Click on "Add New"

Wo Wordpress plugins

4. Click on the Search Plugins toolbar and search for "Header and footer"

Wordpress plugin search header and footer

5. At the WPCode plugin, click on "Install Now" and then on "Activate"

Wordpress plugin search wp code

6. Back at the plugins page, click on "Code Snippets" under the WPCode entry

Wordpress wp code options

7. Click on "Add New"

wordpress wp code add new snippet

8. Under the "Most Popular" section you will see "Add Your Custom Code" and click on "Use snippet"

wordpress wp code add custom snippet

9. Set a title for the script

wordpress wp code custom snippet title

10. Paste the script code of your Affiliatly account

wordpress wp code custom snipped code

11. For location, select "Site Wide Footer" (Make sure to keep the "Auto Insert" option enabled as it is by default)

wordpress wp code custom code insertion location

12. Leave the toggle on "Active" and save the snipped by clicking at "Save Snippet"

wordpress wp code custom snippet activation

After finishing the code embedding, you can follow one of your affiliate's link to count as a visitor, and check for them on your Affiliatly account.

Hopefully, this will help you move forward in this project. If you have any more questions and the answers are not available here, contact us.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us