When your website loads for a visitor, SourceTrak quickly and efficiently finds phone numbers on your website and replaces them with tracking numbers. But what if new phone numbers are added to the page after SourceTrak has found and replaced the original set of numbers when the page loaded? The answer is to use the SourceTrak Re-Render feature.
Scenarios like this are common when dealing with a locations search page, or a searchable map, where visitors are triggering changes on the page by entering search criteria for a location. These changes are happening after the initial page load (when SourceTrak is run). In order for new numbers that have been added to the page to be replaced with SourceTrak tracking numbers, you must make SourceTrak aware that the page has changed. This is done through the SourceTrak render method.
It is as simple as calling
you have finished adding new numbers to the page. If you are adding a list of numbers,
wait until you have finished adding the list and only call
after all the numbers have been added to the page, rather then calling
after adding each individual number.
For example, imagine you have a page on your website that dynamically updates a list of locations
on the page, based on the zip code a visitor enters. If a visitor enters 60190, and triggers your location
finder to update the page with a list of all locations that match that zip code, you would then call
_st.render(); after all of the new locations have been added to the page. This would
cause SourceTrak to re-examine the page, looking for new phones numbers and replacing them with
Below you can see an example of SourceTrak Re-Render in action. Here we have map with
a location pin. The address and phone number for the pin is not loaded onto the page
until a visitor clicks on it. After the visitor clicks on the pin, that data is loaded and
displayed to the visitor. By calling the
_st.render(); function after the
location data is loaded and displayed to the visitor, SourceTrak is able to find the
newly added phone number (an 877 number) and replace it with the appropriate SourceTrak
tracking number (an 815 number).