How to add Google Analytics, Meta Pixel or LINE Tag and ask visitors first
Paste a Google Analytics 4, Google Ads, Meta Pixel, LINE Tag or Google Tag Manager ID into your page. By default the page asks each visitor before it loads them, as the law asks in Germany, France, Spain and other places.
To count visits or measure your ads, paste the ID your tool gives you into Tracking codes. A page with a tracking code asks each visitor first: nothing from Google, Meta or LINE loads until the visitor chooses Accept.
Add a tracking code
- In the editor, open Page settings and publishing.
- Under Marketing and tracking, find Tracking codes.
- Paste each ID into its field:
- Google Analytics 4 measurement ID: starts with G-.
- Google Ads conversion ID: starts with AW-.
- Meta Pixel ID: a string of digits.
- LINE Tag ID: the Tag ID from LINE Ads Manager.
- Google Tag Manager container ID: starts with GTM-.
- Check that the field shows Valid format, the page loads this tag once a visitor agrees (at once with Load right away).
- Publish the page, or choose Publish changes if it is already published.
An ID in the wrong format stays in its field, but the page never loads it. Google Tag Manager only takes effect on a custom domain; on a pressagen.com address the page loads the other four.
What visitors see
The first time a visitor opens the page, a bar at the foot of the screen says:
This page would like to use analytics and advertising tracking codes, which may store cookies on your device.
Beside it are two buttons of one size, Decline and Accept, in your page’s colours. While the bar is up, the page ends in room as tall as the bar, so your last card and the links at the bottom scroll clear of it. The bar is in your page’s language when PressaGen’s interface comes in that language, and in English otherwise.
- Accept loads your tracking codes at once. Google Analytics and Google Ads also hear that the visitor agreed, through Google’s consent mode, which Google expects for visitors in the European Economic Area; a Google Tag Manager container hears it too.
- Decline loads none of them, so that visitor is not counted.
The answer holds for 30 days in that browser, and then the bar asks again. On a custom domain one answer covers every page under it; on a pressagen.com address each page asks on its own. A page without a tracking code shows no bar.
Where the law asks for consent first
- Germany: § 25 of the TDDDG allows storing or reading information on a visitor’s device only with their consent, unless it is strictly needed for what the visitor asked for, and analytics and advertising tags are not.
- France: the CNIL, France’s data protection authority, expects consent before analytics and advertising cookies are set, and refusing has to be as easy as accepting.
- Spain: Article 22.2 of the LSSI requires clear information and the visitor’s consent before tags like these store or read data on their device.
Other places, the rest of the European Union among them, have similar rules. As the terms say, you are the one collecting your visitors’ data; this is a summary, not legal advice, so check the rules where your visitors are.
Load tracking codes right away
If your visitors are where no consent is needed, or you ask for it another way, you can turn the bar off:
- Under Tracking codes, find Visitor consent.
- Choose Load right away.
- Choose Publish changes.
The page then loads your tracking codes as soon as it opens, without asking and without telling Google whether the visitor agreed. The reminder beside the choice stays while it is chosen: Laws in Germany, France, Spain and other places require consent first; you are the one collecting this data. To bring the bar back, choose Ask visitors first, then load (default).
Common questions
Why does my analytics tool count fewer visits?
Visitors who choose Decline, or leave without answering, are not counted. Keep that in mind when you compare the numbers with the time before the bar.
How do I see the bar again on my own computer?
Your own answer is kept too. Open the page in a private window, or clear the site’s data in your browser.
Do I still need to say what I collect?
Yes. The bar asks for consent; it does not tell visitors what you collect or why. Say so on your page, as the terms ask.
Related: Get found in search