Optimize
2.3K members online now
2.3K members online now
Learn how to create your first experiment and get tips on creating A/B, redirect, and multivariate tests.
Guide Me
star_border
Reply

How add snippet on word press website

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I am using WordPress, however, I found it hard to install snippet code.kindly assist!

1 Expert replyverified_user

How add snippet on word press website

Participant ✭ ✭ ☆
# 2
Participant ✭ ✭ ☆

Hi Lindile,

I'm sharing a video on this. Just follow all the steps.

 

https://www.youtube.com/watch?v=nw_-nDq-Doc

 

you can also place code manually in header.php.

 

If you need more assistance please let us know.

 

Thanks

How add snippet on word press website

Top Contributor
# 3
Top Contributor

Except the question is in the Optimize forum :-)

@Lindile R did you want to just install Google Analytics on Wordpress or also install Optimize?

VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

How add snippet on word press website

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Thanks for the video but this is not what were looking for.I am doing A/B testing on my home page tenttechnics.co.za using google optimizer so in order to do that, I have to place the code from header and I'm kinda new on this tool

How add snippet on word press website

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

yes, I want to install Optimize

How add snippet on word press website

Top Contributor
# 6
Top Contributor

OK what Wordpress plugin do you use?

VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

Re: How add snippet on word press website

[ Edited ]
Top Contributor
# 7
Top Contributor

OK nevermind, you're using MonsterInsights :-)

 

 Go to your plugin's settings and add some custom code:

Screenshot 2017-03-23 10.51.32.png

 

The required code should look like:

__gaTracker('require', 'GTM-12345');

(replace with the container ID provided by Optimize)

 

VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

Re: How add snippet on word press website

Top Contributor
# 8
Top Contributor

The end result after you save changes and look at your site's page code should be:

 

 

	__gaTracker('create', 'UA-123456789-1', 'auto');
	__gaTracker('set', 'forceSSL', true);
	__gaTracker('require', 'GTM-12345');
	__gaTracker('require', 'displayfeatures');
	__gaTracker('require', 'linkid', 'linkid.js');
	__gaTracker('send','pageview');
VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

How add snippet on word press website

Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭

Thanks for so much for easy steps, however, how to view the code. I tried using page source but I can't  find tracking code in the page source. kindly assist

Marked as Best Answer.
Solution
Accepted by topic author Lindile R
March

How add snippet on word press website

[ Edited ]
Top Contributor
# 10
Top Contributor

I realize I have a typo in my screenshot; make sure the added code is:

__gaTracker('require', 'GTM-12345');    <-- the trailing semicolon is required!

Otherwise your tracking is fine :-) 

VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan