In both 1.4 and 1.x.dev, two single-line textfield profile fields I created Full Name,profile_fullname and District,profile_district do not show in the javascript.
They are listed and highlighted in the GA module page. The built in profile fields like userid and role do show.
I guess this is a bug.

The js is like, pageTracker._setVar("####:test:authenticated user,roles,another role,another role::");

So its expected, but not getting filled in.

Comments

sgriffin’s picture

I also changed/checked the profile field to public, with no affect.

hass’s picture

Have you read:

Upgrade info:
All people upgrading from 5.x-1.3 or earlier should be aware, we flipped the tracking logic to the opposite. From 5.x-1.4 and above we only track a role if this role is explicitly checked. This makes sure we are not starting to track internal roles you don't like to be tracked.

sgriffin’s picture

yes. how is that relevant?
The roles are being tracked, but the code is not is not loading the specified profile variables into the page tracker line.
They show up blank.

sgriffin’s picture

I believe the bug is in // Add User profile segmentation values;

Trying out the code by itself also returns blank values
Line 60-74

hass’s picture

Status: Active » Closed (works as designed)

I tried this myself.

0. activated - core "profile" module

First test:
1. Added two fields
2. Added some example data for my testuser
3. Marked the new profile fields in GA configuration to be tracked
4. checked the code added to the page: pageTracker._setVar("My display name:http://example.com");
5. looks as expected

Second test:
6. cleared the url field in user/1
7. checked code pageTracker._setVar("My display name:");
8. looks as expected

Please check the selected profile fields that should be tracked on your site and check if there are values in the user fields. If the field values are blank you get the results you see in 7. Everything works as expected - and please let me say - i haven't changed much on this lines... the implode haven't changed in v1.4 - only change is the drupal_to_js around to make sure nobody can inject arbitrary code that may break the tracking. See #153243 and #178765 what have happened in past.

sgriffin’s picture

Status: Closed (works as designed) » Active

I'm not sure how this become closed.
The profile fields are selected, and there is data in the user fields.
The core is 5.1 so perhaps the method of accessing the profile data has changed.

http://soundzabound.com/user/test
Checking the user page you can see two new profile fields, fullname and district. But the tracking code is still blank.
login is test / 1234

Thank you for checking

hass’s picture

From outside i cannot see anything wrong in the test user...

hass’s picture

Only for debugging, could you place a

print '<pre>'; var_dump($fields); print '</pre>'; one line before $segmentation = 'pageTracker._setVar('. drupal_to_js(implode(':', $fields)) .');';

And a print '<pre>'; var_dump($profile_fields); print '</pre>'; before foreach ($profile_fields as $field => $title) {

And a dump of $p

into the file "googleanalytics.module" and post the results, please!?

sgriffin’s picture

After logging in I see
pageTracker._setVar("3940:test:::")

I should see
pageTracker._setVar("3940:test:Firstname Lastname:District:")

because on the ga admin page I have 4 things selected on user segmentation Userid , Username, Full_Name, and District.

Userid and Username are coming in fine, but Full_Name and District are resulting in the :::

hass’s picture

What type of profile fields are Full_Name and District?

sgriffin’s picture

single-line textfield

Output is
array(5) {
["uid"]=>
string(3) "uid"
["name"]=>
string(4) "name"
["profile_fullname"]=>
string(16) "profile_fullname"
["profile_district"]=>
string(16) "profile_district"
["profile_test2"]=>
string(13) "profile_test2"
}

array(5) {
["uid"]=>
string(4) "3940"
["name"]=>
string(4) "test"
["profile_fullname"]=>
NULL
["profile_district"]=>
NULL
["profile_test2"]=>
NULL
}

hass’s picture

Very strange... i tested single-line textfield myself, too.

hass’s picture

Status: Active » Postponed (maintainer needs more info)

As discussed by mail need info until you debugged your machine and install.

sgriffin’s picture

Tested two servers with apache Apache/1.3.37
php 4.4.7
php 4.4.3

profile plus module is able to access the custom profile data and add it to /search
drupal lists the custom profile data on the user pages correctly

D6 Fresh install with no extra modules
D5 with many modules.
Both show the bug.

I guess a sql query could be made to access profile_values with the custom listed fields.

hass’s picture

I guess a sql query could be made to access profile_values with the custom listed fields.

Yes, maybe devel module will help... look for profile_load_profile and then try to execute the SQL by hand and see what you get back

sgriffin’s picture

Yes, if I put profile_load_profile($user); into the GA module the bug is fixed.
I placed it after line 40

hass’s picture

line 40? in D5 it should be 63 and in D6 line 97.

sgriffin’s picture

Yes, I just put profile_load_profile($user); after global $user

But $p = profile_load_profile($user);
works also.

I guess we can close this one.. As to why module_invoke does not work as expected.. I'm not the right person to ask!

hass’s picture

Ask your hosting provider... could be something in apache/php or blocked functions/features, but i'm sure you will have many troubles if module_invoke is not working well.

Closing makes sense.

sgriffin’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

No, there are 60 websites running php on those servers without issues. And about a dozen running drupal. This is the first issue I've traced down to module_invoke.