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.
Now that we have it, let's get started with the process!
1. Go to your WordPress Dashboard
2. Click on Plugins
3. Click on "Add New"
Wo4. Click on the Search Plugins toolbar and search for "Header and footer"
5. At the WPCode plugin, click on "Install Now" and then on "Activate"
6. Back at the plugins page, click on "Code Snippets" under the WPCode entry
7. Click on "Add New"
8. Under the "Most Popular" section you will see "Add Your Custom Code" and click on "Use snippet"
9. Set a title for the script
10. Paste the script code of your Affiliatly account
11. For location, select "Site Wide Footer" (Make sure to keep the "Auto Insert" option enabled as it is by default)
12. Leave the toggle on "Active" and save the snipped by clicking at "Save Snippet"
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.