ASA2 Functions
  • Package
  • Function

Packages

  • API
  • Helper
  • i18n
  • Options
  • OptionsShortcuts
  • Renderer
  • Repo

Functions

  • asa2_collection_exists
  • asa2_filter_asin
  • asa2_get_associate_id_for_url
  • asa2_get_default_country_code
  • asa2_is_asin
  • asa2_is_item_object
  • asa2_is_supported_country_code
  • asa2_replace_tracking_id

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"
Package: Helper
Since: 1.8.0
Located at functions.php

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.
ASA2 Functions API documentation generated by ApiGen