PDA

View Full Version : displaying a piece of HTML code only on successful user activation page?


Kdicuori
01-07-2009, 10:22 AM
Hello,

I have been asked to add a custom google tag only to be displayed on the user's activation confirmation page (the http://www.myvbulletinforum.xx/register.php?register.php?a=act&u= etc etc etc page). The goal is to track users who actually complete their activation (don't ask me why they want to do it that way, marketing has its own evil and mysterious ways).

I have positively tried everything I could think of to get it done.

I can track the used template to the STANDARD_ERROR template. I tried adding this to the template:


<if condition="$bAddGoogleAdsTracker">
<!-- Google Code for Conversion Page -->
blah blah blah
<!-- / Google Code for Conversion Page -->
</if>


and this hook


global $bAddGoogleAdsTracker;
$bAddGoogleAdsTracker = TRUE;


to any hook I found it might be relevant by examining register.php, namely these:

register_activate_start
register_activate_process
register_addmember_complete

with no success at all.

I tried to add the variable as global, no global, to try and read the URI directly in the template and put that into a condition, nothing worked. I still can't make it come out.

I even tried moving the code into the "forum jump" condition, but it seems that this forum jump code gets added even on the /register.php?do=addmember pages - even though it has no content. So I would get the tag included in the wrong step.

Unfortunately I have found no way of debugging this except doing a different registration every time and after 15 gruelling test user registrations, I am at my wit's end and clueless :(

Any help would be very appreciated.

Thanks,

M.

Bellardia
01-07-2009, 01:05 PM
Edit - Actually the register_addmember_complete is called after the success message is parsed, so it may be too late to add HTML at that point. Let me check a bit more first.

Kdicuori
01-07-2009, 01:33 PM
Edit - Actually the register_addmember_complete is called after the success message is parsed, so it may be too late to add HTML at that point. Let me check a bit more first.

Thank you Bellardia, I'll be waiting for news from you.

M.

Dismounted
01-08-2009, 02:23 AM
register_activate_process
$footer .= 'YOUR GOOGLE CODE HERE, ESCAPE ALL SINGLE QUOTES!';

Kdicuori
01-08-2009, 09:20 AM
register_activate_process
$footer .= 'YOUR GOOGLE CODE HERE, ESCAPE ALL SINGLE QUOTES!';

Dismounted, thank you, it worked perfectly.

I wonder why my solution did not work though: maybe vbulletin does not pass all variables to templates? or do I need to pass them in a specific way for them to be seen and used in the templates? Maybe knowing the why of this will help me in implementing future fixes quicker.

Can you give some advice on this?

Thank you again,

M.

Dismounted
01-08-2009, 09:49 AM
The variable you used does not exist because the error is called through standard_error(), and therefore, the variable is out-of-scope. The global keyword is used to bring a variable into scope, and does not work the way you think it does.

Kdicuori
01-08-2009, 10:13 AM
The variable you used does not exist because the error is called through standard_error(), and therefore, the variable is out-of-scope. The global keyword is used to bring a variable into scope, and does not work the way you think it does.

Ok, so basically I hit that hurdle because of the specific situation, while I should have no such problems in other templates, correct?

Thanks again!

M.

Dismounted
01-08-2009, 10:49 AM
Ok, so basically I hit that hurdle because of the specific situation, while I should have no such problems in other templates, correct?
Correct, most of the time, what you did will work.