Function asa2_replace_tracking_id
Replaces the tracking ID in an Amazon URL with the given one.
Example:
$url = asa2_replace_tracking_id('https://www.amazon.com/dp/B008JAAT5Y/tag=evil-tag-21', 'my-own-id-21'); // $url will contain "https://www.amazon.com/dp/B008JAAT5Y/tag=my-own-id-21"
Parameters summary
string |
$url |
Amazon URL. |
string |
$newTrackingId = null |
Optional. The new tracking ID which should be used in the given URL. If unused, the default tracking ID is used. |
boolean |
$addIfNoneWasFound = true |
Optional. Add the given tracking ID even when no tracking ID was found in the URL. Default: true. |
Return value summary
string
|
The URL that may have been modified. |