Help with awk and accessing variable values within the syntax

I'm writing a bash script, and I am having trouble with this line:

awk '{print "url = \"http://www.example.com/directory/$type/"$1"\""}' input.file > output.file

Within the URL being printed, I wish the value of the variable "$type" to be printed, after being read from user input from the terminal. However, the quotation marks associated with the awk command do not allow the value of the variable to be called (syntax highlighting doesn't recognize $type as a variable, but rather as a literal part of the URL). Thus, the URL that ends up being printed literally has "$type" printed as a part of it. I would like to know how to change this behavior so that the actual value of the variable $type is printed within the URL instead. Any help would be appreciated.

echo "enter the value of type"
read type
awk -v type=$type '{printf("url = \"http://www.example.com/directory/%s/%s/\"\n",type,$1)}' input.file > output.file

Wow, I have no idea why it worked, but it worked. Thanks a lot.