Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

DTM - Fire Third-Party Pixel Only Once Per Visitor?

Avatar

Avatar
Validate 25
Level 2
davidb98884514
Level 2

Likes

8 likes

Total Posts

37 posts

Correct Reply

0 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile

Avatar
Validate 25
Level 2
davidb98884514
Level 2

Likes

8 likes

Total Posts

37 posts

Correct Reply

0 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile
davidb98884514
Level 2

15-10-2015

I have one DoubleClick tag on several different pages set via DTM. Is it possible to have the tag fire only once per visitor, regardless of how many times a visitor views a page with the DoubleClick tag on it?

Thanks in advance!

-David

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Contributor
MVP
joshd7227840
MVP

Likes

275 likes

Total Posts

241 posts

Correct Reply

70 solutions
Top badges earned
Contributor
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Contributor
MVP
joshd7227840
MVP

Likes

275 likes

Total Posts

241 posts

Correct Reply

70 solutions
Top badges earned
Contributor
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
joshd7227840
MVP

15-10-2015

First, create a new Data Element.  

Name: isExistingVisitor

Type: Custom Script

Default Value: false

Remember this value for: Visitor

Then open the code editor for the Custom Script and put the following:

var dtm_ev = _satellite.readCookie('dtm_ev'); _satellite.setCookie('dtm_ev','true',1000); dtm_ev=dtm_ev?'true':'false'; return dtm_ev;

Now save the Data Element.

Then, go to your Page Load Rule where you have your DoubleClick tag. 

Go to Conditions, and for Criteria, select Data > Data Element Value, and click the Add Criteria button.

Then in the Data Element dropdown that appears, choose "isExistingVisitor", and for the Value, put "false" (no quotes).

Save the rule and Approve/Publish the Data Element and Page Load Rule.

What this does is create a data element that first reads a cookie, then returns true or false depending on the cookie. If the cookie is not found, we return false, to signify that this is not an existing visitor. Otherwise we return true, to signify that it is an existing visitor.  The cookie is set to expire 1000 days into the future and gets bumped up every time the page is loaded.  The Data Element is also set to remember the returned value for "Visitor" life-cycle. This is probably overkill, but meh, why not. 

Then, the Page load rule is now set to trigger only if the data element returns false.  So, as long as a visitor does not delete the cookie, it should only trigger the page load rule once.  Or.. if the visitor leaves and comes back after 1000 days, the cookie will have expired and the page load rule will trigger.

Answers (2)

Answers (2)

Avatar

Avatar
Validate 25
Level 2
davidb98884514
Level 2

Likes

8 likes

Total Posts

37 posts

Correct Reply

0 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile

Avatar
Validate 25
Level 2
davidb98884514
Level 2

Likes

8 likes

Total Posts

37 posts

Correct Reply

0 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile
davidb98884514
Level 2

15-10-2015

Great! How might one going about doing that?

Avatar

Avatar
Validate 1
Employee
Ben_Bytheway
Employee

Likes

40 likes

Total Posts

62 posts

Correct Reply

22 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Employee
Ben_Bytheway
Employee

Likes

40 likes

Total Posts

62 posts

Correct Reply

22 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
Ben_Bytheway
Employee

15-10-2015

Yes.  🙂