AdWords
3.8K members online now
3.8K members online now
Get started with AdWords - learn the basics to get set up for success
Guide Me
star_border
Reply

Tracking code for remarketing.

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I am having issues with the tracking code for remarketing. The line of code that Google says we change is not really in my GA tracking code. So it is a bit confusing knowing which line of code to change. Foor example this is my tracking code:

 

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-xxxxxxxxx', 'xxxxxxxx-xxx.com');
ga('send', 'pageview');

</script>

 

Now the help says I should change this:

 

ga.src=('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';

 

with this;

 

ga.src=('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js'

 


As you can see from the above there does not seem to be any commonality.

 

In my previous set up for GA, it was rather easy to do this. Did something change?

 

Anyone there who can help?

 

Cheers

 

Princewill

 

 

1 Expert replyverified_user

Re: Tracking code for remarketing.

Collaborator ✭ ✭ ✭
# 2
Collaborator ✭ ✭ ✭

Hello PrinceWill ! Welcome to the Community !

 

I think you have the old analytics code implemented. The new code has a little different implementation , you can find instructions here :

 

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

 

Backup your old code or the entire website before applying this change

It's the same copy-paste before the </head> tag, but using the new code.

 

 

Re: Tracking code for remarketing.

Top Contributor
# 3
Top Contributor

Hi Princewill O,

 

Replace //www.google-analytics.com/analytics.js

 

With stats.g.doubleclick.net/dc.js

 

And you should be good to go. Documentation says it works with all versions of the code.

 

Best of Luck!

 

Pete

 

petebardo -- Deadhead doing AdWords

Re: Tracking code for remarketing.

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭
Does this works for you?

I'm having the same issue.

The old code looks like this:

&lt;script type="text/javascript">

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-xxxxx-1', 'xxxxx.com');
ga('send', 'pageview');

&lt;/script&gt;

I'm replacing with this:

&lt;script type="text/javascript">

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//stats.g.doubleclick.net/dc.js','ga');

ga('create', 'UA-xxxxx-1', 'xxxxx.com');
ga('send', 'pageview');

&lt;/script&gt;


WILL THIS WORK???