Badge Auto-grant -> Catalog Page View

Giving away badges is great, but are they helping direct traffic to your catalog page? If not, try this code. Whenever someone auto-grants him/herself, the price they pay is a redirection to your catalog page. Oh, they still get the badge, but you never know, someone might actually make a purchase, too.

The first line of script is where you specify your IMVU avatar ID number. This is used to identify the badge granting button the user clicks, and also the URL for your catalog page.

The second line is a list of badge numbers. In IMVU, your badges are numbered XXXXXXX-YY where XXXXXXX is your IMVU avatar ID, and YY is the badge number. I only have one badge, but I assume IMVU is numbering them consecutively. If you have multiple badges, use [1,2,3,4] as your array. If you only have 1 badge, just use [1] to create an array with one element. If you are unsure about your badge numbering, open up your HP using Google Chrome, and right click the badge button and select "Inspect Element" - the ID will show up there in the HTML.

The next line is a for loop that iterates through the badge numbers you specified in your array. The next line, we use IMVU's YUI code to attach an extra event to the button click of the "grant-badge-XXXXXXX-YY" element. This opens up your product page in a new tab (for most people) or a new window.

Let me know if you have any issues or questions, thanks! Cheri

This code snippet was originally contributed by Cheri Imvu. Go to the author' imvu website.