The package can track when and how many times a subscriber clicked on a link in a campaign.
To use this feature, you must set
true on a campaign you’re going to send. You can find an example of how to do this in the section on how to create a campaign.
When you send a campaign that has click tracking enabled, we’ll replace each link in the mail with a link that points to the
Spatie\EmailCampaigns\Http\Controllers\TrackOpensController. A route to this controller has been set up by the
Route::emailCampaigns you used when configuring the package.
Here’s an example: a link with
https://spatie.be will be replaced with
When sending a campaign to a large list, that endpoint could be hit a lot over a short timespan. To ensure a fast response time, when the
TrackOpensController is hit, it will not update the database, but dispatch a job named
RegisterClickJob. The controller will respond with a redirect to the url that is the
redirect URL parameter. The dispatch
RegisterClickJob job update the database.
Because there’s the potential for a great many of these jobs to be scheduled, we recommend using a separate queue for handling them. You can configure the queue to be used in the You can configure the queue to be used in the
perform_on_queue.register_click_job key of the
email-campaigns config file.