Title: Define in function GTMCODE
Last modified: January 18, 2018

---

# Define in function GTMCODE

 *  [Renan Bernordi](https://wordpress.org/support/users/altendorfme/)
 * (@altendorfme)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/define-in-function-gtmcode/)
 * I have a blog that works for several domains (but it is not a multi-domain of
   wordpress), I was trying to define the GTM_CODE by the functions of my theme 
   with:
 * define(‘GTM4WP_OPTION_GTM_CODE’, ‘GTM-XXXXX’);
 * This would be the correct parameter, can I do this?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/define-in-function-gtmcode/#post-9876130)
 * Hi,
 * This constant is internal to the plugin and should not be modified. It defines
   where to find the proper key in the settings array for the GTM container code.
   This does not store the GTM ID itself.
 * Setting plugin parameters via PHP codes is not a recommended approach as I can
   not guarantee that this will work in future versions. May I ask why you want 
   to do this?
 *  Thread Starter [Renan Bernordi](https://wordpress.org/support/users/altendorfme/)
 * (@altendorfme)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/define-in-function-gtmcode/#post-9876673)
 * I have a wordpress theme that fits multiple domains, I know I can control various
   domains by GTM, but it would be easier to have multiple GTM IDs per organization.
 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/define-in-function-gtmcode/#post-9877135)
 * It is currently not possible to define plugin options in a programmatic way, 
   you need to enter every parameter on the plugin UI.
 * There are plans to introduce multisite features where you can enter a container
   ID once for all sites in the network but I can not give you an ETA for this.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Define in function GTMCODE’ is closed to new replies.

 * ![](https://ps.w.org/duracelltomi-google-tag-manager/assets/icon-256x256.png?
   rev=1708451)
 * [GTM4WP - A Google Tag Manager (GTM) plugin for WordPress](https://wordpress.org/plugins/duracelltomi-google-tag-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/duracelltomi-google-tag-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/reviews/)

## Tags

 * [define](https://wordpress.org/support/topic-tag/define/)
 * [function](https://wordpress.org/support/topic-tag/function/)

 * 3 replies
 * 2 participants
 * Last reply from: [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/define-in-function-gtmcode/#post-9877135)
 * Status: not resolved