This feature is only available in the Pro version of Independent Analytics.
When generating a campaign URL with the required UTM parameters, the URL can become very long. This can look ugly when you have to paste the full URL somewhere, like a social media post.
In order to make the link more appealing, you can use a link shortener. We would like to include a link shortener in IA Pro in a future update, but for now, we recommend Short.io, which has a very generous free plan.
An example
Here’s an example of what a full-length campaign URL might look like:
Using a free link shortener like this one, you could turn it into a shortened URL like this:
https://shorturl.at/xVRcw
When a visitor clicks on this link, they will be redirected to the full-length URL, and your campaign data will still get recorded by Independent Analytics Pro.
While this does effectively shorten the URL, there are a couple of ways to make it look nicer. First, it helps if you can customize the slug to make it readable, and it’s even better if you can brand the domain too.
With Short.io, you can use a custom domain for your shortened links. For example, we use iawp.io as a short, branded URL for our own redirects. This allows us to create shortened links that look like this:
https://iawp.io/cool-campaign-here
Using a branded domain looks more professional, and you have full control over the URL slug this way.
It is extremely difficult to find a .com domain under five characters long, so we recommend checking other TLDs like .io and .org.
This feature is only available in the Pro version of Independent Analytics.
With all the tracking tools available in Independent Analytics Pro, it can be tricky to decide which technique will best fit the job.
Generally speaking, if you need to track clicks on a link on your website, you’ll want to use the click-tracking feature. Alternatively, if you need to track clicks on a link on someone else’s website, you’ll want to use a campaign URL.
If you have a landing page on your site with a “Signup” button, you can track clicks on it by adding a new link pattern in the Click Tracking Menu. This will work whether the “Signup” button takes visitors to another page on your website or an external website.
Now, let’s say you want to track clicks in an ad placed on another website. You can use a campaign URL to track how many visitors reach your website via this link. As long as the link points to your website and includes the required UTM parameters, the visitors will be recorded in the Campaigns report.
When a visitor reaches your site from another website, the browser normally includes the domain of the referring website. This is how Independent Analytics (and every other analytics app) is able to report on where your traffic came from.
Traffic from emails is harder to track because most inboxes, like Outlook and Apple Mail, will hide the referrer info from the browser. This is done primarily for security purposes, and it means that Independent Analytics is not able to report accurately on how many visitors reached your site via email. These visitors are included in the Direct referrer instead.
However, there is a way to win back most of this data with the Campaigns feature in Independent Analytics Pro.
When sending an email to your list, you can include campaign parameters in each URL linking to your website. When a visitor clicks on one of these links, IA Pro will be able to record their visit in the Campaigns report. Using the UTM parameters, you can then see exactly how many visitors you’ve gotten from each individual email you’ve sent.
These visitors will still be reported as coming from the Direct referrer in the Referrers report, but this way, you’ll be able to get accurate visitor counts for your email broadcasts in the Campaigns report.
Click Tracking is Not Compatible with GoDaddy’s “Managed WordPress” Hosting
This feature is only available in the Pro version of Independent Analytics.
GoDaddy blocks all PHP execution outside of WP without the option to whitelist individual files on their Managed WordPress hosting plans, so it is not possible to use the click tracking feature in Independent Analytics Pro with these plans.
You can use a normal “Web Hosting” plan provided by GoDaddy without any issues. This hosting is cheaper and can be used to host a WordPress website. There is only a conflict with their more expensive Managed WordPress hosting plan.
This feature is only available in the Pro version of Independent Analytics.
There are a few reasons why you could see missing sales in the analytics.
Track logged-in visitors
First, make sure that you are tracking logged-in visitors. Otherwise, the activity of your logged-in customers will go untracked, leading to unrecorded sales.
Check the order statuses
Independent Analytics only reports orders with certain statuses, including Processing, Refunded, and Completed. If your store has custom order statuses added by a plugin, those won’t be tracked by default.
You can choose which order statuses should be counted via the Analytics > Settings menu. You can update these at any time to change which orders are shown in the analytics.
Check your error log
If the solutions above don’t help, then there may be an error occurring during the checkout process. Please enable error logging on your site and then wait until another sale goes untracked. You can then check the debug log for a “Fatal” error that occurred at the same time as the sale.
The debug log will be located in the /wp-content/ folder.
If you need additional assistance, please reach out to us at support@independentwp.com, and we’ll be happy to help.
This feature is only available in the Pro version of Independent Analytics.
In order to track clicks, Independent Analytics Pro uses a PHP endpoint located in wp-content/plugins/independent-analytics-pro/iawp-click-endpoint.php .
This endpoint operates without loading WordPress, which makes it dramatically faster. However, there are some security tools that prevent PHP files from being executed without WordPress getting loaded first, and this blocks click tracking from working.
There are three tools that we are currently aware of that block the PHP execution IA Pro requires to track clicks:
Solid Security
Cloudways
Security Optimizer
Sucuri Security
Here are the steps to resolve each of these conflicts.
Solid Security
If you are using the Solid Security plugin, you will need to disable the option that blocks PHP execution in the plugins folder.
To do so, visit the Security > Settings menu. Then, click on the Advanced section and open the System Tweaks Settings. Lastly, uncheck the Disable PHP in Plugins box and save your settings.
Once saved, the notice warning you about this setting will disappear, and click tracking will resume. You can continue to block PHP execution in both the uploads and themes folders.
Cloudways
If you’re using Cloudways, it disables all PHP execution by default, so this needs to be enabled for click tracking in IA Pro to work.
In order to enable PHP execution, start by clicking on your server and choosing the site application in Cloudways. Next, click on Application Settings and then open the WordPress Settings menu. Lastly, enable the Direct PHP Files Access option and save your changes.
If you want to limit PHP execution in other folders, you could use Solid Security to lock down the themes folder and uploads folder.
Alternatively, you can upload an .htaccess file to the uploads folder to disable direct PHP access there. Here is a tutorial on how to do that.
Security Optimizer
If you’re using the Security Optimizer plugin, there is an option called “Lock and Protect System Folders” that will block PHP execution throughout the site.
In order to get click tracking to work, please toggle that option off and then back on.
Independent Analytics Pro includes a filter that whitelists the PHP endpoint used for click-tracking. The option in Security Optimizer just needs to be toggled off and on so that it can recreate the .htaccess file, including the whitelist rule defined by IA Pro. Then, your clicks on your site will be tracked.
Sucuri Security
Start by visiting the Sucuri Security > Hardening & Prevention menu. There is a setting called Block PHP Files in WP-CONTENT Directory that blocks the click tracking feature in IA Pro. Rather than disabling this feature, you can whitelist the one file that IA Pro needs access to instead.
In the Allow Blocked PHP Files section at the bottom of the page, use the dropdown to select the second option ending with “wp-content.” Then, add the following text and submit the form: /plugins/independent-analytics-pro/iawp-click-endpoint.php
This will allow IA Pro to access the PHP file it needs to use so your visitors’ clicks can be tracked.
Other hosts
If you are using a different host that blocks direct PHP file access, check if there is an option to whitelist a URL. The click-tracking will be able to function properly if you can whitelist the following URL:
If the security rule blocking PHP access is not coming from your host or a plugin, then it is most likely a leftover security rule from a previously installed security plugin.
Connect to your site via FTP and open the wp-content folder. In this folder, open the .htaccess file, and check if it contains code like this:
# Block direct access to all PHP files
<FilesMatch "\.(?i:php)$">
<IfModule !mod_authz_core.c>
Order allow,deny
Deny from all
</IfModule>
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
</FilesMatch>
This code will block direct access to all PHP files in the wp-content folder. You can either remove it or add the following code to the bottom of the .htaccess file to keep direct access blocked, but make an exception for the endpoint that Independent Analytics Pro uses:
# Allow access to the click tracking endpoint
<Files iawp-click-endpoint.php>
<IfModule !mod_authz_core.c>
Allow from all
</IfModule>
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</Files>
If you are having trouble following these instructions or making the necessary changes, please reach out to us via the contact page, and we will be happy to assist you.
Note: When tracking links with a class, please make sure to use a unique class name that does not show up anywhere else on your website.
Adding classes with the Block editor
If you want to track clicks on a Button block, start by selecting the button in the editor.
In the right-sidebar, click on the Advanced section, and then enter the class name into the Additional CSS Class(es) field.
Save your post, and then all clicks on this button will be tracked.
If your link is in another block type, like a paragraph, the steps are the same. However, please note that if you have multiple links within the same paragraph, clicks on all of them will be tracked.
If you have multiple links within a paragraph and you want to track just one, this is possible if you edit the HTML and add the class to the link element itself.
To do this, you would start by selecting the paragraph block. Then, click the Options icon in the toolbar and choose the Edit as HTML option.
Once you’re editing the HTML, you can manually add the class to the link like this:
After adding the class, click the Edit visually button to return the paragraph to its normal state.
This will allow you to add different classes to links within the same paragraph and track their clicks separately.
Adding classes with the Classic Editor
If you’re using the Classic Editor plugin, then the first step is to click on the Text tab at the top-right of the editor.
Once you’re viewing the plain text of the article, you can add the class attribute and value into the link element like this:
You can use this same technique to add a class to any link when using the Classic Editor. You can also add the class to a parent element, but we recommend adding the class to the link element whenever possible.
Adding classes to menu items
It’s easy to track clicks on menu items, whether you’re using a classic theme or a block theme.
Classic themes
For classic theme users, start by visiting the Appearance > Menus page. Once there, click on the Screen Options tab at the top-right of the screen, and then check the CSS Classes box.
Once this field is enabled, you can click on any menu item to open its options and enter the class into the CSS Classes field.
Block themes
If you’re using a block theme, start by clicking on the Appearance > Editor menu item.
In the next screen, click on the Navigation item. Then, click on the three dots icon to the right of the menu name and click the Edit link in the small popup.
On the next page, click on the menu item you want to edit. Then, in the right-sidebar, click the Advanced section and add the class name to the Additional CSS Classes section.
Elementor
If you’re editing your site with Elementor, adding a class to a widget is very easy.
Start by selecting the widget, click the Advanced tab at the top, and then add the class into the CSS Classes field.
Please note that any links within the widget will be tracked. For most widgets, this won’t be an issue, but if you do end up with a widget that includes multiple links, try splitting the widget into multiple widgets. For example, a toggle widget that includes two buttons could be split into two separate button widgets.
HTML
If you’re working with HTML, you can manually add a tracked class to a link, like this:
We recommend adding the trackable class to the <a> element, but you can add it to a parent element too. This will work for up to 7 layers of hierarchy. For example, clicks will still get tracked if the class is added like this:
This allows for more flexibility if, for some reason, it’s difficult to add the class to the link or if you want to quickly track multiple links within one element. Speaking of which, please keep in mind that if there are multiple links within an element, like the <div> above, clicks on all of the links will get tracked.
Clicks are counted for the following elements:
<a>
<button>
<input type="submit">
<input type="button">
<audio>
<video>
Please make sure that you are tracking one of these elements, as clicks on other elements, like <div> and <img> will not be tracked.
This feature is only available in the Pro version of Independent Analytics.
The Click Tracking menu is where you’ll configure which links you want to track. The Clicks report is where you’ll find the click data for those links.
Like the other reports, the Clicks report includes the Quick Stats, chart, and data table. At this time, there is only one metric available (Clicks), so there isn’t an option to toggle the Quick Stats like in other reports.
In the data table, you’ll find three columns. The Link Name comes from the Click Tracking menu, the Target is the URL the link pointed to, and the last column contains the number of clicks.
Pre-made reports
There are several pre-made reports in the sidebar that take advantage of the filtering system. For example, if you click on the PDFs report, you’ll see that it has one filter applied that only includes links that match the PDF pattern created in the Click Tracking menu.
The filters are the key to getting the most out of the Clicks report, so let’s look more closely at them.
Using the filters
You can filter your reports by any of the three data columns:
Link Name
Target
Clicks
Filtering by Link Name is extremely useful because it allows you to generate a report for any of the link patterns created in the Click Tracking menu.
For example, let’s say you have the following set of link rules:
You’ll see each of them available when filtering by Link Name:
This makes it very easy to see the clicks for one of your link patterns.
Filtering by the link Target is very useful as well. For example, let’s say you are tracking clicks on PDFs and you have multiple links in your data table, like this:
This makes it easy to compare clicks between your PDFs, but what if you want to see click data for just one of them?
If you want to see clicks only on the daily meal plan PDF, for instance, you can add a second condition that says to only include links whose target contains “daily-meal-plan.”
With this filter applied, you’ll only see clicks for the PDF file specified.
By default, the data table in the Clicks report will show all of the links that have been clicked. This lets you differentiate between links via their Target URLs.
Alternatively, you can update the table to group link patterns together. You can do this by clicking on the Links dropdown above the table and changing the value to Link Patterns.
This lets you see the total number of clicks for each link pattern.
This can be useful for seeing the total number of clicks for each link pattern and comparing clicks between link patterns.
This feature is only available in the Pro version of Independent Analytics.
There are two different approaches to tracking outbound clicks with Independent Analytics Pro. You can either track specific domains, or you can simply track clicks on all external domains.
The benefit of tracking individual domains is that the Clicks report will show a targeted list of clicks that you truly care about.
On the other hand, tracking all outbound links can lead to lots of clutter. You will see clicks on links in your articles that are not important to your business. This means you will need to make more use of the filtering system to uncover clicks that actually matter to you. With that said, for large content sites with lots of client/sponsored content, there may be hundreds of individual domains that need to be tracked, so tracking all external clicks would be the superior option.
Please keep this in mind when choosing the method you prefer to track outbound clicks.
Method 1: track specific domains
Let’s say you have an Etsy shop, and you link to your store frequently. If you want to track how many times visitors click on links pointing to your Etsy store, you could do so by adding a new Domain link pattern like this:
The domain link pattern will record every click on links pointing to the specified domain, and you can create as many of these patterns as you need.
Once you’re tracking clicks on all the external domains you want to monitor, it’s time to create the report.
Creating the report
To create the outbound clicks report, we’ll apply a couple of filters.
Visit the Clicks report, and then add a filter that excludes all links that contain your own domain in the Target URL.
Replace mywebsite.com with your own site’s domain
This condition alone should work well, but you might still see links for email addresses and phone numbers. To exclude them, add two new conditions, each excluding the email and phone number links by name.
With all three conditions added, apply the filter, and you’ll be left with only clicks on external links.
Lastly, click the Save As button to save your customizations as a new report you can revisit in the future.
Now, you have a report showing only clicks on outbound links that you can customize further whenever needed.
Method 2: track all external clicks
If you’d prefer to track all external clicks, that can be done very easily with the External link pattern.
Click the Add Link Pattern button to add a new pattern, name it “External” or “Outbound,” and choose the External type. Then, click Save to begin tracking.
The External link pattern doesn’t require a value
With this link pattern added, clicks on every link pointing to another website will be tracked.
Creating the external clicks report
Creating a report with this data is simple. All you have to do is add a filter to show only clicks that match the External link pattern, like this:
After applying this filter, the data table will only show links that point to external domains.
You can save your results as a new report to quickly revisit your outbound click data in the future.
This feature is only available in the Pro version of Independent Analytics.
Here is a link to the debugging guide referenced in the video.
Click tracking in Independent Analytics Pro is controlled via the Click Tracking menu, so that’s where we’ll begin this tutorial.
How the Click Tracking menu works
The Click Tracking menu displays a list of “link patterns.” Whenever a visitor clicks on a link that matches one of these patterns, the click will be tracked.
For example, the first link pattern is named “Buy Now,” and it will be triggered whenever a link with the class “buy-now” is clicked.
As another example, the second link pattern called “PDF” will be triggered whenever a visitor clicks on a link pointing to a PDF file.
Using this system, you can create link patterns that will track clicks for individual links or hundreds of links at once.
Let’s dive into each of the available link patterns and look at how they’re implemented now.
Link Patterns
Most of the link patterns start working automatically once configured in the Click Tracking menu.
However, the Class link pattern takes a bit more work, so we’ll cover this one first.
Class
Tracking links by class is the best strategy if you want to measure clicks on a single link. For example, if you have a signup button on a landing page, you could easily add a tracked class to it.
You can track clicks on the signup button by adding a new Class pattern, like the example below:
The pattern is named “Landing Page Signup Button,” the Class type is selected, and in the value field, the class name given is “track-signup-button.”
If this class is not already on the signup button, then the last step is to add the class to it.
We have a tutorial here on adding classes to links via the Block Editor, Classic Editor, Menu Editor, Elementor, and manually with HTML.
Once the class is added, you’ll begin seeing click data enter the Clicks report.
If your clicks aren’t showing up, follow our click debugging guide to make sure the class is implemented properly.
ID
While classes are the recommended way to track clicks on specific buttons and links, you can also use an ID. We recommend using an ID as a fallback option if you can’t add a class.
For example, imagine you add a chat plugin to your site, and it adds a button to the bottom of each page. The button doesn’t have a unique class you can add or a way to edit the HTML, but it does have an ID. In this scenario, you can track the button by using the ID.
If you’d like to manually add an ID to an element by editing the HTML, here’s how you can do that:
The extension pattern tracks clicks on links pointing to files. For example, if your site has downloadable CSV files and you want to see how often they’re clicked, you could do so like this:
As long as the links point directly to a CSV file, their clicks will be tracked. This works whether the file is hosted on your website or if you’re linking to a file hosted elsewhere.
With just one file extension pattern, you can monitor clicks on hundreds of links across your website.
Since it’s common to track PDF and zip file downloads, Independent Analytics Pro tracks these two file types by default, but you can remove those patterns if you’d like.
Subdirectory
The subdirectory link pattern is especially useful for tracking affiliate links, which are commonly redirected through a local URL.
For example, imagine you’re linking to a product through this URL: https://yourwebsite.com/go/product-x
You could track these clicks by adding a subdirectory link pattern like this:
Now, every time a visitor clicks on a link that goes through your /go/ subdirectory, it will show up in the Clicks report like this:
This report is filtered to only show the Affiliate Link clicks
The Target URL column in the table lets you distinguish between your links. Using the example above, you could filter the Target URL by links that contain “green-tea,” and then you’d only see stats for the second link in the table.
With this system, you can track all of your affiliate links within a few seconds of configuration and then use filters to dig into your data later.
Domain
In our experience, tracking all outbound clicks creates a lot of clutter. It’s not helpful to see clicks to Wikipedia and other sites you linked to in your content. That’s why we included the domain pattern.
By using the domain pattern, you can track clicks that point to specific domains only. For example, let’s say you have an Etsy shop, and you frequently link to your store. You could quickly track clicks on all links pointing to Etsy like this:
If there are any links to your store that you want to track separately, you could add a tracked class to those links instead.
When you track a domain, it doesn’t only track links leading to the homepage; it tracks links pointing to any URL on that domain. In other words, you can add this one pattern in a few seconds, and Independent Analytics Pro will record clicks on every link pointing to any page on that domain.
External
While most sites can stick to tracking a few individual domains, there are times when it makes more sense to track all outbound links.
Tracking all outbound links is easy with the External link pattern.
This link pattern doesn’t require a value to be configured. Just add it to your list of patterns, and all clicks on outbound links will be tracked.
Protocol
The protocol link pattern lets you track clicks on links with specific protocols. Links to webpages use the “https” protocol, but there are also protocols for links that send emails, make phone calls, and send text messages.
Tracking for phone and email links is enabled by default, but you can easily archive and delete these link patterns if you don’t need them. There is also an option to track SMS links that open text messaging when clicked.
If you want to track clicks on WhatsApp links, you can do that with the Domain link pattern rather than tracking a protocol.
Important notes
To use the click-tracking feature in Independent Analytics Pro successfully, there are a few other things you should be aware of.
Clear the cache after making changes
Whenever you make a change to your tracked links, please remember to clear your site’s cache so that these updates make it into the tracking script that IA Pro adds to each page of your website.
If you are using a CDN like Cloudflare, you may need to clear your site’s cache via your caching plugin first and then empty the CDN cache.
Click data is synced every 60s
Click data is synced once every minute with the database, so please allow for that delay when testing a new link pattern on your site.
Archive links if you want to stop tracking
If you no longer want to track clicks for a certain link pattern, you can click the Archive link next to it. We have a tutorial on archiving links here if you want to learn more.
Right-clicks are tracked too
Both left- and right-clicks are tracked. This is important because a lot of visitors may right-click links and choose to open them in new tabs or right-click a PDF and choose to download it.
Clicks can be counted multiple times in the table
Let’s say you’re tracking clicks on PDF links, and you’ve also added a tracked class to a link that points to a PDF. When somebody clicks on this link, it will be counted as one click in the Quick Stats and chart, but you’ll see two clicks in the data table. This is because both the tracked class and PDF pattern get credit for the click.
Drag-and-drop to rearrange link patterns
You can drag and drop the link patterns into a new order by clicking and dragging them anywhere besides the Edit and Archive buttons.
Debugging
If you are having trouble getting your clicks to track, please follow all the steps in our debugging guide.