Find and Use the URID for Perl

Important Notes:

“mm_urid” is used in the examples below. If you have defined your own variable, please change ALL “mm_urid” references to the variable name you selected when setting up the click URL.

You must replace the default Goal ID (“12345”) with the App Tracking ID given to you by your Account Manager or when you registered on mMedia.

Don’t have an App Tracking ID? Do one of the following:

This code requies the LWP package.

Step 1: Add the following code inside the header of each page that is a part of the conversion process.

...
$urid = "";
chomp($urid = param("mm_urid"));
if ($urid == "") $urid = "No URID";
...

This will ensure that the URID value follows the user throughout the conversion process.

...
print "<a href=\"thankyou.pl?mm_urid=".$urid."\" >Submit Conversion</a>"
...

Step 3: On the final page of the conversion, place the following code.

Steps 1 and 2 make sure our URID variable follows the user to this final page and is available.

The following code will grab the URID from the URL string and populate it within the the API call.

Once complete, it will automatically submit the conversion event to Millennial Media’s Conversion Tracking API.

...
# Conversion Tracking Start
	
	$goalID = 12345;		
	
	$urid = "";
	chomp($urid = param("mm_urid"));
	if ($urid == "") $urid = "No URID";
	
	use LWP::Simple;
	$response = get( "http://cvt.mydas.mobi/handleConversion?goalid=".$goalID."&urid=".$urid );
	
# Conversion Tracking End
...