I've had a request from a client to add allowLinker and useAmpClientId to the google analytics create method. I think it should be added via the 'Create only fields' section in the module admin form. I've added the fields there but these fields appear to be disallowed the following error is displayed - "Create only field name allowLinker is a disallowed field name. " I have found this error message within the code, so I assume this is specifically disallowed by the module authors.

There is a patch available for the Drupal 7 version of the module. Is there going to be a similar update to the Drupal 8 version? If so is there a schedule of when this is going to be released?

Comments

james.pearce created an issue. See original summary.

hass’s picture

Title: AllowLinker and useAmpClientId » Add useAmpClientId to create fields

True/false is allowed.

AllowLinker is set via domain settings automatically.

hass’s picture

https://support.google.com/analytics/answer/7486764?hl=en

If you use analytics.js
Include the following in your Analytics tracking code:

ga('create', 'UA-XXXXX-Y', 'auto', {'useAmpClientId': true});

If you use gtag.js
Include the following in your Analytics tracking code:

gtag('config', 'UA-XXXXX-Y', {'use_amp_client_id': true});

  • hass committed 7862118 on 8.x-3.x
    Issue #2984485 by hass: Add use_amp_client_id to create fields
    

  • hass committed c6df832 on 8.x-2.x
    Issue #2984485 by hass: Add useAmpClientId to create fields
    

  • hass committed 1e8fda2 on 7.x-2.x
    Issue #2984485 by hass: Add useAmpClientId to create fields
    

  • hass committed b6fc6da on 6.x-4.x
    Issue #2984485 by hass: Add useAmpClientId to create fields
    
hass’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

oliverpolden’s picture

Is this correct? If I add useAmpClientId to the "Create only fields" then I get the following output:
ga("create", "UA-XXXXX-Y", {"cookieDomain":"auto","useAmpClientId":true});
i.e.
useAmpClientId is added as an element to the third parameter, not as a fourth.